.NET Core-Azure部署任务中的设置环境变量 [英] .NET Core - Set Environment Variable in Azure Deployment Task
问题描述
我目前正在尝试使用launchSettings.json
文件来管理应用程序的环境变量,因此我的Setup.cs
文件可以通过env.IsDevelopmentEnvironment()
等方式来管理环境.
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.
在VSTS中,如何在Azure部署任务上设置环境变量ASPNETCORE_ENVIRONMENT
?还是应该将其添加到构建步骤中已完成的dotnet publish
任务中?
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?
推荐答案
由于ASPNETCORE_ENVIRONMENT
是环境变量,因此只需在Azure上指定它即可.
Because ASPNETCORE_ENVIRONMENT
is an environment variable, you can just specify it on Azure.
请参见 查看全文