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



















I am not certain the place you are getting your information, however great topic. I must spend some time learning more or figuring out more. Thank you for magnificent info I used to be in search of this information for my mission.
You made some clear points there. I did a search on the subject and found most guys will agree with your site.
Simply a smiling visitor here to share the love (:, btw outstanding pattern. “He profits most who serves best.” by Arthur F. Sheldon.
Some truly nice and useful information on this internet site, too I believe the style and design contains superb features.
Hey very cool web site!! Man .. Excellent .. Amazing .. I’ll bookmark your blog and take the feeds also…I am happy to find a lot of useful info here in the post, we need work out more techniques in this regard, thanks for sharing. . . . . .
Excellent post. I was checking continuously this weblog and I am inspired! Very useful information specially the ultimate phase 🙂 I maintain such info a lot. I was looking for this particular info for a very lengthy time. Thank you and good luck.
I have not checked in here for a while as I thought it was getting boring, but the last few posts are good quality so I guess I will add you back to my everyday bloglist. You deserve it my friend 🙂
I love your writing style genuinely enjoying this website .
The next time I read a blog, I hope that it doesnt disappoint me as much as this one. I mean, I know it was my choice to read, but I actually thought youd have something interesting to say. All I hear is a bunch of whining about something that you could fix if you werent too busy looking for attention.
Aw, this was a very nice post. In concept I would like to put in writing like this moreover – taking time and precise effort to make a very good article… but what can I say… I procrastinate alot and in no way appear to get one thing done.
Hello, Neat post. There’s a problem together with your website in web explorer, might test thisK IE nonetheless is the marketplace chief and a good component of folks will leave out your great writing due to this problem.
You could definitely see your enthusiasm in the work you write. The world hopes for more passionate writers like you who are not afraid to say how they believe. Always go after your heart.
I am often to blogging and i really appreciate your content. The article has really peaks my interest. I am going to bookmark your site and keep checking for new information.
Virtually all of the things you say is astonishingly appropriate and that makes me wonder the reason why I had not looked at this in this light previously. Your article truly did switch the light on for me as far as this specific topic goes. However at this time there is actually 1 point I am not really too comfortable with and while I try to reconcile that with the core theme of the issue, let me observe exactly what all the rest of your subscribers have to point out.Well done.
I will right away snatch your rss as I can’t to find your email subscription link or newsletter service. Do you’ve any? Kindly allow me know so that I could subscribe. Thanks.
There is obviously a lot to identify about this. I consider you made some nice points in features also.
Thanks for another fantastic article. Where else could anybody get that kind of info in such a perfect way of writing? I have a presentation next week, and I’m on the look for such info.
I like this website very much, Its a very nice spot to read and get information. “From now on, ending a sentence with a preposition is something up with which I will not put.” by Sir Winston Churchill.
You completed certain good points there. I did a search on the subject matter and found the majority of folks will consent with your blog.
Thank you for sharing superb informations. Your website is so cool. I’m impressed by the details that you have on this site. It reveals how nicely you perceive this subject. Bookmarked this website page, will come back for extra articles. You, my pal, ROCK! I found just the information I already searched everywhere and just couldn’t come across. What a great web-site.
Loving the information on this internet site, you have done outstanding job on the posts.
You really make it seem so easy with your presentation but I find this matter to be really something that I think I would never understand. It seems too complex and very broad for me. I’m looking forward for your next post, I will try to get the hang of it!
NEUROCEPT REVIEW
My spouse and i ended up being so fulfilled that Michael managed to round up his researching with the precious recommendations he came across from your very own web pages. It is now and again perplexing just to always be offering concepts which often a number of people might have been trying to sell. And we all do understand we’ve got the writer to give thanks to because of that. All the illustrations you’ve made, the straightforward blog menu, the relationships your site aid to create – it is many spectacular, and it’s really leading our son in addition to our family understand this subject matter is entertaining, which is truly serious. Many thanks for the whole lot!
F*ckin¦ remarkable things here. I am very glad to see your post. Thanks a lot and i am taking a look ahead to contact you. Will you please drop me a mail?
I’d perpetually want to be update on new posts on this internet site, bookmarked! .
This is the right blog for anyone who wants to find out about this topic. You realize so much its almost hard to argue with you (not that I actually would want…HaHa). You definitely put a new spin on a topic thats been written about for years. Great stuff, just great!
I was looking through some of your posts on this site and I think this internet site is really instructive! Retain putting up.
I as well as my guys have been taking note of the nice information from your web blog while all of a sudden I got a terrible suspicion I never expressed respect to the site owner for those techniques. All of the young men became certainly passionate to study all of them and now have without a doubt been enjoying those things. Thank you for getting well kind and also for pick out some tremendous resources millions of individuals are really desirous to learn about. My personal sincere regret for not expressing appreciation to sooner.
I have been absent for a while, but now I remember why I used to love this blog. Thanks, I will try and check back more often. How frequently you update your website?
Hello there! Do you know if they make any plugins to assist with SEO? I’m trying to get my blog to rank for some targeted keywords but I’m not seeing very good gains. If you know of any please share. Thanks!
Keep up the wonderful piece of work, I read few posts on this internet site and I believe that your web site is rattling interesting and contains lots of fantastic information.
As a Newbie, I am constantly browsing online for articles that can benefit me. Thank you
I really wanted to write a simple remark to be able to thank you for all of the remarkable tips and tricks you are giving out on this site. My time-consuming internet lookup has at the end been compensated with beneficial suggestions to talk about with my friends and classmates. I would mention that most of us readers actually are definitely endowed to dwell in a wonderful site with very many lovely professionals with very beneficial opinions. I feel somewhat lucky to have seen your website page and look forward to tons of more enjoyable moments reading here. Thanks once again for a lot of things.
You made some nice points there. I looked on the internet for the topic and found most individuals will consent with your blog.
As I website possessor I believe the content material here is really superb, regards for your efforts.
I really like your writing style, great info, regards for putting up :D. “Much unhappiness has come into the world because of bewilderment and things left unsaid.” by Feodor Mikhailovich Dostoyevsky.
It is actually a nice and useful piece of info. I am satisfied that you just shared this helpful info with us. Please keep us informed like this. Thanks for sharing.
I like this weblog very much, Its a real nice position to read and get info . “The superior man is modest in his speech, but exceeds in his actions.” by Confucius.
I definitely wanted to write a quick word to say thanks to you for some of the fabulous tricks you are sharing at this website. My incredibly long internet search has at the end of the day been recognized with incredibly good facts and strategies to talk about with my two friends. I would say that we website visitors actually are really fortunate to exist in a great website with very many lovely people with interesting methods. I feel very happy to have seen your web site and look forward to plenty of more exciting times reading here. Thanks a lot again for a lot of things.
Saved as a favorite, I really like your blog!
When I initially commented I clicked the -Notify me when new comments are added- checkbox and now each time a remark is added I get 4 emails with the identical comment. Is there any approach you may remove me from that service? Thanks!
Real wonderful info can be found on web blog.
Hey there! This post could not be written any better! Reading this post reminds me of my previous room mate! He always kept chatting about this. I will forward this write-up to him. Pretty sure he will have a good read. Many thanks for sharing!
I was studying some of your content on this site and I think this website is very instructive! Retain posting.
There is noticeably a bundle to find out about this. I assume you made certain nice points in features also.
whoah this blog is great i love studying your posts. Keep up the good work! You recognize, many people are hunting round for this info, you can help them greatly.
Does your blog have a contact page? I’m having trouble locating it but, I’d like to shoot you an email. I’ve got some suggestions for your blog you might be interested in hearing. Either way, great website and I look forward to seeing it develop over time.
Hello.This post was extremely fascinating, particularly because I was browsing for thoughts on this matter last Friday.
Im now not positive where you’re getting your info, however great topic. I needs to spend some time learning much more or working out more. Thanks for great information I used to be on the lookout for this information for my mission.