Open APIWT opened 5 years ago
@PureKrome thanks. That works. I wasn't aware. That saves me from having to add another config file.
@PureKrome I am sorry, I have still confused, I know this is still open what is the best way of configuring serilog in function app, Should weuse appsetting.json should for Serilog or like you mentioned, have key values pair in azure app setting and local.settings.json and use that. What is the preferred way and why? It would so helpful to have the clear understanding on that. I am super new to azure function app.
@trinzya you have two options here
this is: "use local.settings.json
. There are opinionated design-reasons*** for this. so just stick with this.
this is: use appsettings.<env>.json
... but guess what? You're going to have to customize the start up code to tell the azure functions to read in these files. blah blah blah.
Azure devs will say the preferred way is their way (option 1 above) Some other people might say: stick with custom way (option 2 above) because that brings in some consistency with our own team of people who work with ASP.NET Core etc etc blah blah blah.
I've picked the option-1 because i'm old and don't want to fight the system. I've had my cry, rolled around on the floor, picked myself up and moved on. I've stopped trying to fight over small things. I've made peace 🕊️ with my inner OCD.
@PureKrome Thank you! In my case, my company prefers the second option. Our simple and fun explanation makes it crystal clear for me why 🙂
Is your question related to a specific version? If so, please specify:
v2 (latest)
What language does your question apply to? (e.g. C#, JavaScript, Java, All)
C#
Question
What is the proper way to get access to IConfiguration and ILogger inside a custom startup class?