Azure/azure-functions-dotnet-extensions

Documentation and Samples for new IWebJobsConfigurationStartup support

brettsam opened this issue · 5 comments

This is a tracking issue that will be updated with a link to documentation and samples once they are merged.

FYI, @anthonychu ; not sure if Brett has worked with you on this yet, but I'll reach out for context

This is in progress.

@brettsam @fabiocav
To prioritize AppService-Settings as well as ASP.NET Core + Web Apps,
I think the implementation would look like this.

builder.ConfigurationBuilder
.AddJsonFile(Path.Combine(context.ApplicationRootPath, "appsettings.json"), optional: true, reloadOnChange: false)
.AddJsonFile(Path.Combine(context.ApplicationRootPath, $"appsettings.{context.EnvironmentName}.json"), optional: true, reloadOnChange: false)
.AddEnvironmentVariables();

I think the sample should be modified.

https://devblogs.microsoft.com/premier-developer/order-of-precedence-when-configuring-asp-net-core/

Thanks @HiroyukiSakoh. I've submitted a change to the doc sample to add environment variables last. Should be live in the next 24 hours.