We are having difficulty reading configuration section of our Azure App Service from the code. We have a specific need to read a flag from App Service's own configuration section. I have added the new property in Azure Portal to the App Service's Configuration section. I am following https://learn.microsoft.com/en-us/azure/app-service/configure-common?tabs=portal
and
To read the variables as environment variables but with no luck.
I also want to mention that we are trying to read the configuration variables from our .NET Core 3.1 application and I have implemented the following three different ways to read the variable with all being unsuccessful:
var authType = configuration["AUTHTYPE"];
var authType2 = configuration.GetValue("AUTHTYPE");
var authType3 = Environment.GetEnvironmentVariable("AUTHTYPE");
AUTHTYPE is the name of the configuration in the local configuration section of the app service. I have tried reading this configuration as "AUTHTYPE", "ASPNETCORE_AUTHTYPE" and "APPSETTING_AUTHTYPE" and all have failed to retrieve the value.
Please help us on how to access these variables as this problem is currently blocking us. Please also let me know if you need more information or details. Thank you,
Murat