NET provides support for passing options via environment variables, appsettings.json, and XML files. as well as command line arguments. In short, each higher level overrides the settings in lower levels.
To add options:
- Create a public class and name it (we’ll use funcOptions)
- Add a string property called returnValue (or name it whatever you like) and set the property to some value (e.g., MyOptions)
- We’re going to override that value in applications.json
- Add a property in appsettings.json (e.g., retVal) and set that property to a different value than we did in step 2
It’s time to set up the startup configuration. When you are done, your Program.cs should look like this:
var host = new HostBuilder()
.ConfigureFunctionsWebApplication()
.ConfigureServices((context, services) =>
{
services.AddApplicationInsightsTelemetryWorkerService()
.ConfigureFunctionsApplicationInsights()
.AddOptions<MyOptions>
.BindConfiguration("");
})
.Build();
host.Run();
The next step is to inject IOptions<MyOptions> and in the constructor set a member variable.
The Run method will look like this:
[Function("Function1")]
public IActionResult Run(HttpTrigger(AuthorizationLevel
.Anonymous, "get", "post")] HttpRequest req)
{
return new OKObjectResult(options.value.retValue);
}

Lovely website! I am loving it!! Will come back again. I am taking your feeds also
I’m not sure exactly why but this blog is loading very slow for me. Is anyone else having this issue or is it a issue on my end? I’ll check back later on and see if the problem still exists.
Great beat ! I wish to apprentice while you amend your site, how can i subscribe for a blog website? The account helped me a acceptable deal. I had been a little bit acquainted of this your broadcast offered bright clear concept
so much excellent information on here, : D.
I’m not that much of a online reader to be honest but your sites really nice, keep it up! I’ll go ahead and bookmark your site to come back later on. Cheers
I enjoy forgathering utile information , this post has got me even more info! .
Great write-up, I’m normal visitor of one’s site, maintain up the nice operate, and It’s going to be a regular visitor for a long time.
I like what you guys are up too. This type of clever work and reporting! Keep up the fantastic works guys I’ve added you guys to our blogroll.
Fascinating blog! Is your theme custom made or did you download it from somewhere? A theme like yours with a few simple tweeks would really make my blog jump out. Please let me know where you got your theme. Appreciate it
I got good info from your blog
I as well believe therefore, perfectly pent post! .
I keep listening to the rumor talk about getting boundless online grant applications so I have been looking around for the best site to get one. Could you advise me please, where could i acquire some?
It’s really a great and helpful piece of info. I am glad that you simply shared this helpful information with us. Please stay us informed like this. Thank you for sharing.
I have recently started a blog, the information you provide on this web site has helped me greatly. Thank you for all of your time & work.
so much fantastic information on here, : D.
This is a very good tips especially to those new to blogosphere, brief and accurate information… Thanks for sharing this one. A must read article.
I like your writing style truly enjoying this web site.
Nice post. I learn something more challenging on different blogs everyday. It will always be stimulating to read content from other writers and practice a little something from their store. I’d prefer to use some with the content on my blog whether you don’t mind. Natually I’ll give you a link on your web blog. Thanks for sharing.
I was looking through some of your blog posts on this internet site and I believe this site is real instructive! Retain putting up.
I do agree with all of the ideas you’ve presented in your post. They are really convincing and will certainly work. Still, the posts are very short for novices. Could you please extend them a bit from next time? Thanks for the post.
Hello. impressive job. I did not imagine this. This is a great story. Thanks!
Real informative and good body structure of written content, now that’s user genial (:.
I do like the way you have presented this difficulty and it does present me some fodder for thought. Nonetheless, from what precisely I have personally seen, I really trust when the feedback pack on that people stay on point and in no way start on a tirade associated with some other news du jour. Yet, thank you for this fantastic piece and whilst I do not concur with this in totality, I regard your standpoint.
I really appreciate this post. I have been looking all over for this! Thank goodness I found it on Bing. You’ve made my day! Thanks again
I simply could not leave your website prior to suggesting that I actually loved the standard info a person provide to your guests? Is gonna be again ceaselessly to investigate cross-check new posts
An interesting discussion is value comment. I believe that it is best to write more on this matter, it won’t be a taboo topic however usually persons are not enough to talk on such topics. To the next. Cheers
Hey there just wanted to give you a quick heads up. The text in your article seem to be running off the screen in Safari. I’m not sure if this is a formatting issue or something to do with web browser compatibility but I thought I’d post to let you know. The style and design look great though! Hope you get the issue resolved soon. Cheers
I like this weblog its a master peace ! Glad I detected this on google .
I am now not sure the place you are getting your info, but great topic. I needs to spend some time learning more or understanding more. Thanks for excellent information I was in search of this info for my mission.
Hi, Neat post. There is an issue with your site in internet explorer, might check this?K IE nonetheless is the market leader and a big section of other people will omit your magnificent writing due to this problem.
I think this internet site holds some very excellent information for everyone :D. “The test of every religious, political, or educational system is the man that it forms.” by Henri Frdric Amiel.
Absolutely written subject matter, thankyou for information .
Great V I should certainly pronounce, impressed with your website. I had no trouble navigating through all tabs as well as related information ended up being truly simple to do to access. I recently found what I hoped for before you know it in the least. Quite unusual. Is likely to appreciate it for those who add forums or anything, website theme . a tones way for your customer to communicate. Nice task..
I’ve been browsing online more than three hours today, yet I never found any interesting article like yours. It is pretty worth enough for me. In my opinion, if all webmasters and bloggers made good content as you did, the net will be much more useful than ever before.
Hello, I think your website might be having browser compatibility issues. When I look at your blog site in Safari, it looks fine but when opening in Internet Explorer, it has some overlapping. I just wanted to give you a quick heads up! Other then that, great blog!
Have you ever considered about including a little bit more than just your articles? I mean, what you say is valuable and all. But imagine if you added some great graphics or video clips to give your posts more, “pop”! Your content is excellent but with images and videos, this blog could definitely be one of the greatest in its niche. Fantastic blog!
I visited a lot of website but I believe this one holds something special in it in it
It’s really a cool and helpful piece of information. I am satisfied that you just shared this useful information with us. Please stay us informed like this. Thanks for sharing.
naturally like your web site but you have to check the spelling on quite a few of your posts. A number of them are rife with spelling problems and I find it very bothersome to tell the truth nevertheless I will surely come back again.
Having read this I thought it was very informative. I appreciate you taking the time and effort to put this article together. I once again find myself spending way to much time both reading and commenting. But so what, it was still worth it!
Wonderful web site. A lot of useful information here. I’m sending it to some pals ans also sharing in delicious. And certainly, thank you in your effort!
As a Newbie, I am permanently exploring online for articles that can aid me. Thank you
I was curious if you ever thought of changing the layout of your blog? Its very well written; I love what youve got to say. But maybe you could a little more in the way of content so people could connect with it better. Youve got an awful lot of text for only having one or 2 pictures. Maybe you could space it out better?
I admire your work, thankyou for all the useful posts.
Enjoyed reading through this, very good stuff, thanks. “Curiosity killed the cat, but for a while I was a suspect.” by Steven Wright.
It is truly a great and useful piece of info. I am satisfied that you just shared this useful info with us. Please keep us informed like this. Thank you for sharing.
This web page is known as a stroll-by means of for all of the information you wished about this and didn’t know who to ask. Glimpse right here, and also you’ll positively discover it.
Hello, i think that i saw you visited my blog so i came to “return the favor”.I’m trying to find things to improve my site!I suppose its ok to use a few of your ideas!!
I¦ve been exploring for a little bit for any high-quality articles or weblog posts in this sort of space . Exploring in Yahoo I eventually stumbled upon this website. Reading this information So i am satisfied to convey that I’ve a very good uncanny feeling I came upon exactly what I needed. I so much without a doubt will make sure to don¦t disregard this site and provides it a look on a continuing basis.
I was very pleased to find this web-site.I wanted to thanks for your time for this wonderful read!! I definitely enjoying every little bit of it and I have you bookmarked to check out new stuff you blog post.