TL;DR:
How do I fix:
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.
in the Parameters Override dialog, when deploying an ARM Template from files that were built in a pipeline?
I'm creating an ADO Release, using the ARM template deployment
task. As it happens I'm doing this to deploy an ADF instance, but I don't think that detail is relevant to the problem.
I'm having trouble with the Template Parameter Overrides section of the task config:
I've done this previously when my source artifact is a direct reference to a Git repo which contained the Template files, and it worked perfectly. ADO recognised the Git repo, found my target branch, found the relevant files within the codebase, and was able to parse the parameters file, to give me the UI to override those parameters. All good.
Now I'm trying to move to a model where a pipeline builds the Template files for me and publishes them as an artifact to use.
The pipeline seems to work fine, and I've verified that all the relevant files are created.
But when I try to use those files as the artifact source, the Override Parameter dialog can't "find" them. :(
The error message reads:
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.
What am I doing wrong, and how do I fix this?
As I say, I've already verified that the pipeline is generating these files, and that the Release is successfully downloading them. Proof that the files are generated:
- The "Template" and "Template parameters" inputs, both list all the files when browsed:
- I inserted a "log the contents of the working directory" step before the "Deploy an ARM template" step, and it confirms that they're present.
- When I turn on Debug Mode and run the Release pipeline, it confirms that the target files have been found. The release then fails, because the parameters aren't compatible, because I haven't overridden them :) But it did find the files!
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'
Edit: Various values I've tried putting into the "Template" and "Template Parameters" fields, to no avail:
$(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
The first two give the errors above. The rest give errors that they can't even find the artifact, e.g.
Warning: Failed to download the template file from the given path 'D:/A/r1/a/BuiltADFTemplates/IngestArmTemplates/ARMTemplateForFactory.json ' with the following error: There is no such artifact 'D:' linked to this release pipeline.