Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSTS Pipeline Deployment of ARM Error: Could not find any file matching the template file pattern

I am trying to deploy an Azure ARM script in VSTS Pipeline.

I "Published" the Artifacts in the Build Step and Downloaded the Artifacts in the Release Step. The Log seems to indicate that it found the ARM script (After much trial and error. The prescribed manner found here does not seem to work at all).

I however get Error: Could not find any file matching the template file pattern

Incidentally, I get this error even if can't find the file (which makes sense..but not when it actually does find the file). The ARM script deploys correctly when I deploy manually in Azure Portal.

I am using the Azure Resource Group Deployment step in the release pipeline.

I'm not sure what other information might help troubleshoot this, but request and hopefully I can get it to you.

Thanks

2018-12-14T18:32:06.6009951Z ##[section]Starting: Azure Deployment:Create Or Update Resource Group action on ChrisGroup
2018-12-14T18:32:06.6015952Z 

==============================================================================
2018-12-14T18:32:06.6016124Z Task         : Azure Resource Group 
Deployment
2018-12-14T18:32:06.6016287Z Description  : Deploy an Azure resource manager (ARM) template to a resource group. You can also start, stop, delete, deallocate all Virtual Machines (VM) in a resource group
2018-12-14T18:32:06.6016444Z Version      : 2.141.4
2018-12-14T18:32:06.6016526Z Author       : Microsoft Corporation
2018-12-14T18:32:06.6016655Z Help         : [More Information] (https://aka.ms/argtaskreadme)
2018-12-14T18:32:06.6016801Z 
==============================================================================
2018-12-14T18:32:06.9610677Z Checking if the following resource group exists: ChrisGroup.
2018-12-14T18:32:07.2734470Z Resource group exists: true.
2018-12-14T18:32:07.2736899Z Creating deployment parameters.
2018-12-14T18:32:07.2809876Z The detected encoding for file 'D:\a\r1\a\IAC\ARM.json' is 'utf-8'
2018-12-14T18:32:07.3021166Z ##[error]Error: Could not find any file matching the template file pattern
2018-12-14T18:32:07.3030720Z ##[section]Finishing: Azure Deployment:Create Or Update Resource Group action on ChrisGroup

As per request:

In the Template Parameters field I put -dailyreports_name '$(IACWeb)' -dailyreportsapi_name '$(IACAPI)'

and OMG... It's supposed to be a path to a variables file. UGH

Once I put into the Override Template Parameters, it works.

Microsoft should probable reword the label to "Template Parameters File"

like image 627
Chris ten Den Avatar asked Dec 14 '18 19:12

Chris ten Den


1 Answers

You need to put the parameters being passed in into the "Override template parameters". The "Template parameters" field is actually a reference to a file location.

like image 167
Chris ten Den Avatar answered Oct 25 '22 21:10

Chris ten Den