All you need to do is: Include the new appsetting. {env}. json in the publishOptions in file project. json . Go to Azure Portal and open the web application. Select application settings. Add an entry for ASPNETCORE_ENVIRONMENT and set it to whatever you want.