Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Azure by (45.3k points)

I'm currently trying to use the launchSettings.json file to manage the environment variables of the application, so my Setup.cs file can manage the environments in the way of env.IsDevelopmentEnvironment(), etc.

In VSTS, how do I go about setting the environment variable ASPNETCORE_ENVIRONMENT on an Azure Deployment task? Or should it get in the dotnet publish task I've got in my build steps?

1 Answer

0 votes
by (16.8k points)

o define your own environment variable, click to your site → All Settings → Application settings:

Enter image description here

Add an app setting in the "App settings" section:

Enter image description here

You can verify the value from the debug console.

Going to https://{your site name}.scm.azurewebsites.net/DebugConsole:

Enter image description here

Browse Categories

...