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);
}

Cool 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 design. Kudos
Wonderful website. Plenty of helpful information here. I’m sending it to some pals ans also sharing in delicious. And of course, thank you to your effort!
Woh I like your posts, saved to fav! .
I want foregathering utile information , this post has got me even more info! .
I like this weblog so much, saved to my bookmarks. “Nostalgia isn’t what it used to be.” by Peter De Vries.
I have recently started a web site, the information you provide on this site has helped me tremendously. Thank you for all of your time & work.
Hi there, just became aware of your blog through Google, and found that it is truly informative. I am going to watch out for brussels. I’ll be grateful if you continue this in future. Numerous people will be benefited from your writing. Cheers!
I like this weblog its a master peace ! Glad I noticed this on google .
What i do not realize is if truth be told how you’re no longer really much more well-appreciated than you may be right now. You’re very intelligent. You realize thus considerably with regards to this matter, produced me in my view imagine it from numerous varied angles. Its like men and women aren’t fascinated except it is one thing to do with Woman gaga! Your own stuffs excellent. At all times take care of it up!
I like what you guys are up also. Such intelligent work and reporting! Keep up the superb works guys I have incorporated you guys to my blogroll. I think it’ll improve the value of my web site :).
I will immediately clutch your rss feed as I can not in finding your email subscription link or e-newsletter service. Do you’ve any? Please permit me realize so that I may subscribe. Thanks.
F*ckin’ remarkable things here. I am very glad to see your article. Thank you a lot and i am looking forward to touch you. Will you kindly drop me a e-mail?
wonderful points altogether, you just gained a brand new reader. What would you suggest about your post that you made some days ago? Any positive?
There is noticeably a bundle to find out about this. I assume you made sure nice factors in options also.
Those are yours alright! . We at least need to get these people stealing images to start blogging! They probably just did a image search and grabbed them. They look good though!
You are my inspiration , I have few blogs and very sporadically run out from to brand.
I truly treasure your piece of work, Great post.
Great blog! I am loving it!! Will come back again. I am taking your feeds also.
I really like your writing style, superb info, thanks for putting up :D. “I will show you fear in a handful of dust.” by T. S. Eliot.
Great paintings! This is the kind of info that are supposed to be shared around the web. Shame on the seek engines for not positioning this post upper! Come on over and discuss with my web site . Thank you =)
Excellent site. Plenty of useful information here. I am sending it to a few friends ans additionally sharing in delicious. And certainly, thank you in your effort!
Hello! I just would like to give a huge thumbs up for the great info you have here on this post. I will be coming back to your blog for more soon.
Simply a smiling visitant here to share the love (:, btw great pattern.
I as well as my pals ended up examining the best recommendations on the website while at once I had a horrible feeling I never expressed respect to the site owner for those techniques. These guys are actually for this reason happy to read them and have in effect definitely been making the most of them. Appreciation for turning out to be considerably kind and also for deciding upon this kind of nice things most people are really eager to understand about. My personal honest apologies for not saying thanks to you sooner.
Great ?V I should certainly pronounce, impressed with your web site. I had no trouble navigating through all tabs and related information ended up being truly simple to do to access. I recently found what I hoped for before you know it at all. Quite unusual. Is likely to appreciate it for those who add forums or something, website theme . a tones way for your client to communicate. Excellent task..
Super-Duper site! I am loving it!! Will be back later to read some more. I am taking your feeds also
Thanks, I’ve just been searching for information approximately this topic for a while and yours is the best I’ve discovered so far. However, what about the conclusion? Are you sure about the source?
Hi there! This post couldn’t be written any better! Reading through this post reminds me of my previous room mate! He always kept talking about this. I will forward this article to him. Pretty sure he will have a good read. Thank you for sharing!
I am not real wonderful with English but I line up this very easygoing to interpret.
I’ve been exploring for a little for any high-quality articles or blog posts in this kind of area . Exploring in Yahoo I ultimately stumbled upon this web site. Studying this info So i am glad to convey that I have a very good uncanny feeling I came upon just what I needed. I so much unquestionably will make sure to do not fail to remember this website and give it a look on a constant basis.
I¦ve learn a few excellent stuff here. Definitely worth bookmarking for revisiting. I surprise how much effort you put to make this sort of great informative site.
Spot on with this write-up, I really assume this website needs far more consideration. I’ll in all probability be once more to read far more, thanks for that info.
電子菸在台灣市場擁有相當高的知名度,不僅以平價與多口味著稱,還提供從水果清香到經典菸草的多樣選擇,滿足不同需求的玩家。
Its great as your other blog posts : D, thankyou for posting. “A lost battle is a battle one thinks one has lost.” by Ferdinand Foch.
I really appreciate this post. I have been looking all over for this! Thank goodness I found it on Bing. You have made my day! Thanks again
Hey there! This post couldn’t be written any better! Reading this post reminds me of my old room mate! He always kept chatting about this. I will forward this page to him. Fairly certain he will have a good read. Thank you for sharing!
You completed certain fine points there. I did a search on the topic and found the majority of folks will agree with your blog.
I always was interested in this topic and still am, regards for putting up.
Keep working ,remarkable job!
I’m not sure why but this weblog is loading very slow for me. Is anyone else having this problem or is it a problem on my end? I’ll check back later on and see if the problem still exists.
I’ve read some good stuff here. Certainly worth bookmarking for revisiting. I wonder how much effort you put to create such a magnificent informative site.
I’m still learning from you, while I’m improving myself. I definitely liked reading all that is posted on your site.Keep the tips coming. I enjoyed it!
I have been exploring for a little for any high quality articles or blog posts on this sort of area . Exploring in Yahoo I eventually stumbled upon this website. Reading this info So i am happy to exhibit that I have an incredibly excellent uncanny feeling I found out just what I needed. I most indubitably will make certain to don¦t overlook this website and provides it a glance on a relentless basis.
Thanx for the effort, keep up the good work Great work, I am going to start a small Blog Engine course work using your site I hope you enjoy blogging with the popular BlogEngine.net.Thethoughts you express are really awesome. Hope you will right some more posts.
Excellent beat ! I wish to apprentice whilst you amend your site, how can i subscribe for a weblog site? The account helped me a applicable deal. I have been tiny bit acquainted of this your broadcast offered vibrant clear concept
I have recently started a web site, the info you provide on this web site has helped me greatly. Thanks for all of your time & work. “If you see a snake, just kill it. Don’t appoint a committee on snakes.” by H. Ross Perot.
I am now not positive where you’re getting your information, but good topic. I must spend some time learning more or working out more. Thank you for magnificent info I used to be in search of this information for my mission.
What i don’t realize is if truth be told how you are now not actually much more smartly-appreciated than you may be now. You are so intelligent. You recognize therefore considerably in terms of this matter, made me personally believe it from numerous varied angles. Its like women and men aren’t involved unless it is one thing to accomplish with Lady gaga! Your own stuffs outstanding. Always handle it up!
Fantastic web site. Lots of useful information here. I¦m sending it to a few friends ans additionally sharing in delicious. And naturally, thanks for your effort!
Hi there very nice website!! Guy .. Beautiful .. Wonderful .. I will bookmark your website and take the feeds additionallyKI’m satisfied to seek out a lot of helpful information here within the submit, we need develop more techniques in this regard, thanks for sharing. . . . . .