Hello @Steve Odai
I think that the valid environment variables are Development, Production, and Staging. For the value of "Test", you can add this to configuration --> appsettings or hardcode the file name
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I am trying to load my appsettings.test.json file on a test API and I am having problems reading environment variables. Works fine locally but when I push it to the Azure App Service I keep getting pointed to my dev appsettings.json file.
I will attach my settings below and the API call results I used to verify this issue. Every other custom value works aside ASPNETCORE_ENVIRONMENT.
<h3>Azure App Service Application Settings</h3>
![knYLm.png][1]
Hello @Steve Odai
I think that the valid environment variables are Development, Production, and Staging. For the value of "Test", you can add this to configuration --> appsettings or hardcode the file name
FYI, if anyone encounters this issue. My project was originally a .NET CORE 3.1 project, even after upgrading to 6 there were obviously still lingering files which wouldn't be cleared just because I targeted a newer framework.
The culprit was my web.config file, it was overriding my ASPNETCORE_ENVIRONMENT env variable.
<environmentVariables>
<environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" />
<environmentVariable name="ASPNETCORE_HTTPS_PORT" value="44364" />
<environmentVariable name="COMPLUS_ForceENC" value="1" />
</environmentVariables>