app.config
:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="Interval" value="15000" />
</appSettings>
</configuration>
我使用Azure App Service Deploy
任务来部署.NET核心Web作业:
我拥有的所有选项是:我如何使用发行版本的变量来替换我的
app.config
thanks to @levi lu-msft for theInsight。在Azure DevOps中,释放管道转到pipeline>变量
Interval
和值
30000
.在Azure App Service部署任务转到File Transforms&Villiable替换选项
部分。检查XML变量替换
复选框。检查
app.config
文件是部署软件包的一部分,并位于正确的文件夹中。
<add key="Interval" value="15000" />
文件中寻找app.config
。
基于管道变量,它将用value="15000"
代替value="30000"
部署后,转换后的
app.config
文件将看起来像这样:<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="Interval" value="30000" />
</appSettings>
</configuration>