.NET Core-Azure部署任务中的设置环境变量 [英] .NET Core - Set Environment Variable in Azure Deployment Task

查看:144
本文介绍了.NET Core-Azure部署任务中的设置环境变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在尝试使用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.

请参见 查看全文

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆