DevOps 任务在覆盖参数对话框中无法识别 ARM 模板参数

问题描述

TL;博士:

我该如何解决

警告:无法从给定路径“$(System.DefaultWorkingDirectory)/BuiltADFTemplates/IngestArmTemplates/ARMTemplateForFactory.json”下载模板文件错误如下:找不到 IngestArmTemplates/ARMTemplateForFactory.json 项。>

在“参数覆盖”对话框中,从管道中构建的文件部署 ARM 模板时?


我正在使用 ARM template deployment 任务创建 ADO 版本。 碰巧我这样做是为了部署 ADF 实例,但我认为该细节与问题无关。

我在使用任务配置的模板参数覆盖部分时遇到问题:

enter image description here

当我的源工件是对包含模板文件的 Git 存储库的直接引用时,我之前已经这样做了,并且它运行得很好。 ADO 识别了 Git 存储库,找到了我的目标分支,找到了代码库中的相关文件,并且能够解析参数文件,为我提供覆盖这些参数的 UI。一切都很好。

enter image description here

现在我正在尝试转向一个模型,在该模型中,管道为我构建模板文件并将它们发布为要使用的工件。

管道似乎工作正常,我已经验证所有相关文件都已创建。

但是当我尝试将这些文件用作工件源时,“覆盖参数”对话框无法“找到”它们。 :(

enter image description here

错误信息如下:

Warning: Failed to download the template file from the given path '$(System.DefaultWorkingDirectory)/BuiltADFTemplates/IngestArmTemplates/ARMTemplateForFactory.json' with the following error: The item IngestArmTemplates/ARMTemplateForFactory.json Could not be found.

我做错了什么,我该如何解决


正如我所说,我已经确认管道正在生成这些文件,并且发布正在成功下载它们。 文件生成的证明:

  • “模板”和“模板参数”输入,都列出浏览时的所有文件

    enter image description here

  • 我在“部署 ARM 模板”步骤之前插入了 "log the contents of the working directory" step,它确认它们存在。
  • 当我打开调试模式并运行发布管道时,它确认已找到目标文件。然后发布失败,因为参数不兼容,因为我没有覆盖它们:) 但是它确实找到了文件

The detected encoding for file 'D:\a\r1\a\BuiltADFTemplates\IngestArmTemplates\ARMTemplateForFactory.json' is 'utf-8'.

The detected encoding for file 'D:\a\r1\a\BuiltADFTemplates\IngestArmTemplates\ARMTemplateParametersForFactory.json' is 'utf-8'


编辑: 我尝试将各种值放入“模板”和“模板参数”字段中,但无济于事:

$(System.DefaultWorkingDirectory)/BuiltADFTemplates/IngestArmTemplates/ARMTemplateForFactory.json
BuiltADFTemplates/IngestArmTemplates/ARMTemplateForFactory.json

$(System.DefaultWorkingDirectory)\BuiltADFTemplates\IngestArmTemplates\ARMTemplateForFactory.json
$(System.DefaultWorkingDirectory)\\BuiltADFTemplates\\IngestArmTemplates\\ARMTemplateForFactory.json
D:\A\r1\a\BuiltADFTemplates\IngestArmTemplates\ARMTemplateForFactory.json
$(Agent.ReleaseDirectory)/BuiltADFTemplates/IngestArmTemplates/ARMTemplateForFactory.json
$(System.ArtifactsDirectory)/BuiltADFTemplates/IngestArmTemplates/ARMTemplateForFactory.json
$(Pipeline.Workspace)/BuiltADFTemplates/IngestArmTemplates/ARMTemplateForFactory.json
/BuiltADFTemplates/IngestArmTemplates/ARMTemplateForFactory.json

前两个给出了上面的错误。 其余的给出了他们甚至找不到工件的错误,例如

警告:无法从给定路径“D:/A/r1/a/BuiltADFTemplates/IngestArmTemplates/ARMTemplateForFactory.json”下载模板文件错误如下:没有这样的工件“D:”链接到此发布管道。

解决方法

一位同事在 Azure DevOps 的独立实例上重现了该行为,我有理由相信这只是任务中的一个错误。

我已向 Microsoft 提出支持请求:

https://developercommunity.visualstudio.com/myfeedback?space=21&entry=myfeedback