I am moving our configuration from our local configuration store to a central App Configuration Store for all our Azure Functions.
I have created a startup.cs and the code looks as follows
public override void ConfigureAppConfiguration(IFunctionsConfigurationBuilder builder)
{
if (builder == null) throw new ArgumentNullException(nameof(builder));
builder.ConfigurationBuilder
.AddEnvironmentVariables();
var credentials = GetDefaultAzureCredential();
builder.ConfigurationBuilder
.AddAzureAppConfiguration((options) =>
{
options
.Connect(
new Uri(Environment.GetEnvironmentVariable("ConfigurationStorePrimaryEndpoint")),
credentials
)
.Select(KeyFilter.Any, LabelFilter.Null)
.Select(KeyFilter.Any, "DEVELOPMENT");
});
}
I cannot figure out how to read the variables ConfigurationStorePrimaryEndpoint and DEVELOPMENT from the local Configuration on the function itself? I do not want to use env variables I want to read those two values from the local configuration store on each function but I cannot figure out how?
And of course when run locally I want it to use the local.settings.json
Any suggestions appreciated.