I have an application, for which I'm trying to read environment variables from the Azure configuration menu. As such:
Then some code to read environment variables:
public static string GetPathString()
{
string targetEnv = Environment.GetEnvironmentVariable("TARGET_ENVIRONMENT");
if (targetEnv.Equals(Environments.Dev))
{
return "/RCHHRATool/";
}
else if (targetEnv.Equals(Environments.Azure))
{
return "/";
}
return "INVALID ENVIRONMENT SET IN ENVIRONMENT VARIABLES";
}
However, what I'm finding is, the values being read into the code when deployed to Azure are still from web.debug.config, which presumably it shouldn't even be looking at considering it should be in release mode in the app service.
How do I read custom environment variables from the app service configuration?


