问题描述
我正在使用替换令牌扩展
我已将替换令牌任务添加到我们的发布管道中
我的配置文件是这样的
令牌不会被替换,我是 Azure DevOps 的新手,我在这里遗漏了什么吗?
发布活动在发布代理上运行.您正在将应用程序部署到应用服务后运行令牌替换,因此不会部署令牌替换.
这是一个问题.
另一个问题是 Web 部署包是 zip 存档,因此令牌替换不会影响 zip 文件中包含的文件.您不应将令牌替换与 Web 部署结合使用.您应该使用 Web 部署转换(parameters.xml
和 SetParameters.xml
),您正在使用的 Web 部署任务支持这些转换.parameters.xml
允许您定义用于定位要转换的元素的 xpath 表达式,并且 setparameters.xml
文件包含要在转换中使用的值.
i am using the Replace token extension https://marketplace.visualstudio.com/items?itemName=qetza.replacetokens to replace variable in **/*.config files
Our build pipeline creates one artifact that needs to be deployed to all environments
we have 2 environments in our release pipeline(DEV ,QA)
Each environment has a set of variables configured
I have added the replace token task onto our release pipeline
My config files looks like this
The the tokens are not replaces , i Am new to Azure DevOps , am i missing anything here?
Release activities run on the release agent. You're running token replacement after the application is deployed to the app service, so the token replacement isn't getting deployed.
That's one issue.
Another issue is that web deploy packages are zip archives, so token replacement isn't going to affect the files contained in the zip file. You shouldn't use token replacement in conjunction with web deploy. You should use web deploy transforms (parameters.xml
and SetParameters.xml
), which are supported by the web deploy task that you're using. parameters.xml
allows you to define xpath expressions for locating elements to transform, and the setparameters.xml
files contain the values to use in the transformation.
这篇关于Azure Dev ops 替换发布管道中每个环境的令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!