azure - 在 Azure 应用服务部署任务中设置 XML 转换环境

标签 azure azure-devops azure-web-app-service azure-deployment

我正在使用 Azure DevOps Pipeline 将 ASP.NET MVC 系统发布到 Azure Web 应用程序。

我已将构建配置为应用 XML 转换,因此我可以稍后在发布步骤中应用它们,并且可以将相同的构建工件发布到多个环境。

构建工作正常,我最终得到了一个包含未转换的 web.config 和特定于环境的转换文件的工件。

Azure 应用服务部署任务有一个名为“XML 转换”的复选框,它显示以下帮助文本:

The config transforms will be run for *.Release.config and *.<EnvironmentName>.config on the *.config file. Config transforms will be run prior to the Variable Substitution. XML transformations are supported only for Windows platform.

目前,我正在尝试将版本设置到测试环境中,但正在应用 Web.Release.config,而不是 Web.Test.config。我已经搜索了所有可以找到的地方来定义环境以使版本使用测试配置,但我找不到任何地方。

有一个similar question在 GitHub 上,显示以下屏幕截图:

Environment Option

不幸的是我的看起来不是这样的:

enter image description here

我正在努力做正确的事吗?如果是的话,我在哪里设置环境?

最佳答案

您需要确保您的阶段名称只是“Test”,而不是“Deploy EMS to Test”,reference here .

关于azure - 在 Azure 应用服务部署任务中设置 XML 转换环境,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53329425/

相关文章:

azure - 如何使用 v1 Azure AD 应用程序和客户端凭据访问 Sharepoint Online API

node.js - Nodemailer 在 Azure 上抛出错误

docker - 发布构建工件任务结果 'path does not exist'错误

node.js - Azure 网站 - NodeJS - 崩溃

node.js - Azure不将index.html作为可执行入口点

.net - Azure 逻辑应用程序 : How to Send an Email with one or more attachments after getting the content from Blob storage?

azure - 排除临时存储 (D :) from KQL QUERY

Azure 门户 - 将 Web 应用配置为使用 Active Directory,而不是与登录的 Azure 租户关联的目录?

c# - 如何使用 Azure DevOps Pipelines 正确构建 MSI 安装项目?

azure - 无法将 VM 资源添加到 Azure DevOps 环境