Azure / Azure/azure-functions-core-tools

Consider adding support for hierarchical configuration in local.settings.json

Open
#2,263 8 comments 4 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
1.5k
Forks
498
Avg merge
4d 20h
Merged PRs (30d)
14

Description

We 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:

``` json
{
"Values": {
"StorageConnection": "UseDevelopmentStorage=true",
}
}
```

This is what we want to support for AAD auth.
``` json
{
"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)

``` json
{
"Values": {
"StorageConnection__endpoint": "https://pakrym0test0storage.blob.core.windows.net/"
}
}
```

cc @fabiocav @mattchenderson @paulbatum

Contributor guide

Open the contributing guide

Research direction

Start with src/Azure.Functions.Cli/Common/AppSettingsFile.cs at the linked setting-reading code, then compare the flat and nested local.settings.json examples. Verify how hierarchical values should reach IConfiguration, including the AAD endpoint shape, and consider the existing double-underscore workaround as a compatibility reference. Done means nested Values entries are read in the intended shape.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
cli, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.