Consider adding support for hierarchical configuration in local.settings.json
See original GitHub issueWe are planning to use a hierarchical configuration to support different modes of connecting to the service by having.
This is the current shape of settings:
{
"Values": {
"StorageConnection": "UseDevelopmentStorage=true",
}
}
This is what we want to support for AAD auth.
{
"Values": {
"StorageConnection": {
"endpoint": "https://pakrym0test0storage.blob.core.windows.net/",
}
}
}
Considering that functions runtime uses IConfiguration
that already supports hierarchical data but we need to make sure values gets there in the correct shape. AppSettingsFile
would need to change to support this.
Setting reading would need to change https://github.com/Azure/azure-functions-core-tools/blob/28be3f19626161c5cca94d2d4376a2a3350c923b/src/Azure.Functions.Cli/Common/AppSettingsFile.cs#L11
Currently, it’s possible to work around the absence of the feature by using the ASP.NET Core double underscore syntax (https://docs.microsoft.com/en-us/aspnet/core/fundamentals/configuration/?view=aspnetcore-3.1#environment-variables)
{
"Values": {
"StorageConnection__endpoint": "https://pakrym0test0storage.blob.core.windows.net/"
}
}
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:8 (3 by maintainers)
Top GitHub Comments
It’s specially difficult given the lack of documentation around this subject
I get that the
__
notation is not common for .net developers but it is the recommended way in the documentation for hierarchical environment variables for netcore projects, it’s very frustrating to have it not work at all when trying to port an existing application to a function and then needing to unravel all yourappsettings.Development.json
, being unable to map my local settings to a strongly typed POCO for consumption within my project is very frustrating as well