Azure App Configuration from Azure function

291 views Asked by At

I am accessing my configuration stored in Azure Appconfiguration. I am using SDK (Azure.Data.AppConfiguration) from Azure function. Following the example from https://github.com/Azure/azure-sdk-for-net/blob/Azure.Data.AppConfiguration_1.0.2/sdk/appconfiguration/Azure.Data.AppConfiguration/samples/Sample2_HelloWorldExtended.md

I am keep getting 400 error.

Following is my code

 var client = new ConfigurationClient(_azureAppConfigurationOptions.ConnectionString);
            
            ConfigurationSetting setting = client.
                                        GetConfigurationSetting(
                                            "appid");  

the only difference is i am calling from Azure functions.

Any help or insight is appreciated.

1

There are 1 answers

0
Ivan Glasenberg On

When try to get configuration(app settings) in azure function, you should use this method Environment.GetEnvironmentVariable(xxx).

Please refer to this article for details.