0
votes

I followed this tutorial (Build DevOps CI/CD pipeline for Python Flask with Azure DevOps ). In the step 3 (Create Continuous Deployment Release pipeline) of the tutorial I have to create an "Azure resource group deployment" task in a release.

I couldn't find a task with "Azure resource group deployment" name. But I found "ARM Template Deployment" task. Since it's settings was similar to "Azure resource group deployment" task, I assumed they are the same, and it might have been changed since the tutorial's date.

This is the YAML of my task:

steps:
- task: AzureResourceManagerTemplateDeployment@3
  displayName: 'ARM Template deployment: Resource Group scope'
  inputs:
    azureResourceManagerConnection: ####
    subscriptionId: ####
    resourceGroupName: ###
    location: 'North Europe'
    csmFile: '**/windows-webapp-template.json'
    overrideParameters: '-webAppName "####" -hostingPlanName "####" -appInsightsLocation "North Europe" -sku "S1 Standard"'

The release build breaks on this task with the following error:

Error: Could not find any file matching the template file pattern

This is the structure of the folders:

-Application
-ArmTemplate
   -windows-webapp-template.json
-Tests

I have tried all the solutions given in other stackoverflow pages about this condition. I have tried all following paths:

'ArmTemplates/windows-webapp-template.json'
'ArmTemplates\windows-webapp-template.json'
'**/windows-webapp-template.json'
'**\windows-webapp-template.json'
'$(System.DefaultWorkingDirectory)/**/windows-webapp-template.json'
'$(System.DefaultWorkingDirectory)\**\windows-webapp-template.json'
'$(System.DefaultWorkingDirectory)/ArmTemplates/windows-webapp-template.json'
'$(System.DefaultWorkingDirectory)\ArmTemplates\windows-webapp-template.json'

None of the solutions works for me. Could some one please help me?

1
Try this path $(System.DefaultWorkingDirectory)/<name of your build pipeline>/drop/ArmTemplates/windows-webapp-template.json because build pipeline drops the artifacts in drop folder Or you can click on the Browse Template to find your template file.Jagrati Modi
@JagratiModi-AIS , Thanks for your reply. I tried the path but it didn't work. If I click on Browse Template, there's nothing to choose. This is the message when I click on the Browse Template: No artifact sources are linked to this release pipeline. Link artifacts from the pipeline tab.user_5
Are you publishing the artifacts from the build pipeline? And can you check the drop folder?Jagrati Modi
Yes, there is task in the tutorial "Publish build artifacts". This the YAML: steps: - task: PublishBuildArtifacts@1 displayName: 'Publish Artifact: drop'user_5
@JagratiModi-AIS, I can't find drop folder. Where should I look for that?user_5

1 Answers

2
votes

According to your description, it appears that you didn't set the correct Artifacts source for the release pipeline.

If you are using the published build artifacts from previous build pipeline as the source, then please make sure the ARM template is successfully copied and published to the build artifact. (Navigate to your build -> click "x published" -> Drop, make sure the ARM template is there)

enter image description here

After that, please check you release pipeline settings. Just make sure you have linked the published artifacts. Then click the button to browser and select the ARM template from the liked artifacts.

enter image description here