【发布时间】:2021-02-08 16:56:18
【问题描述】:
在我的 .NET Framework 应用程序中,我需要在 ApplicationInsights.config 中更改 Application Insights InstrumentationKey,作为构建不同环境(Dev、UAT 等)的一部分。
在我的解决方案中,我有一个不包含 InstumentationKey 的 ApplicationInsights.config 文件
我还有一个ApplicationInsights.Dev.config转换文件如下
<?xml version="1.0"?>
<ApplicationInsights xmlns="http://schemas.microsoft.com/ApplicationInsights/2013/Settings"
xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<InstrumentationKey>89c95f9d-0f89-41cb-938b-175499e3052a</InstrumentationKey>
</ApplicationInsights>
在我的 YAML 管道中,我有以下步骤:
- task: FileTransform@1
inputs:
folderPath: 'path/to/directory'
enableXmlTransform: true
xmlTransformationRules: '-transform ApplicationInsights.Dev.config -xml ApplicationInsights.config'
构建任务完成,但是当我查看工作目录中生成的 ApplicationInsight.config 文件时,InstrumentationKey 不存在。
谁能看到我在这里做错了什么?
【问题讨论】:
-
这个问题怎么样?下面的答案是否解决了您的问题,如果没有,请告诉我有关此问题的最新信息吗?
标签: azure-devops azure-application-insights