1
votes

I'm trying to deploy simple ARM, but failing. What could be wrong?

ARM File location in Git is ARMTemplates/CreateSQLServerARM/azuredeploy.json

 //Example
 //https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/deployment-tutorial- 
 pipeline

//ERROR
ARM Service Conection deployment scope - Subscription
Checking if the following resource group exists: KensTestRG.
Resource group exists: true.
Creating deployment parameters.
##[error]Error: Could not find any file matching the template file pattern
Finishing: AzureResourceManagerTemplateDeployment

//YML
- task: AzureResourceManagerTemplateDeployment@3
  inputs:
    deploymentScope: 'Resource Group'
    azureResourceManagerConnection: 'AzureRmPipeline-conn'
    subscriptionId: '1111753a-501e-4e46-9aff-6120ed56333'
    action: 'Create Or Update Resource Group'
    resourceGroupName: 'KensTestRG'
    location: 'North Europe'
    templateLocation: 'Linked artifact'
    csmFile: '\ARMTemplates\CreateSQLServerARM\azuredeploy.json'
    deploymentMode: 'Incremental'
1

1 Answers

1
votes

From what I see above you have wrong task type and it cannot find AzureResourceManagerTemplateDeployment@3. Can you use AzureResourceGroupDeployment@2?

Below you have an example usage from doc

- task: AzureResourceGroupDeployment@2
  displayName: 'Deploy template'
  inputs:
    deploymentScope: 'Resource Group'
    ConnectedServiceName: 'demo-deploy-sp'
    subscriptionName: '01234567-89AB-CDEF-0123-4567890ABCDEF'
    action: 'Create Or Update Resource Group'
    resourceGroupName: 'demogroup'
    location: 'Central US'
    templateLocation: 'URL of the file'
    csmFileLink: '$(artifactsLocation)WebSite.json$(artifactsLocationSasToken)'
    csmParametersFileLink: '$(artifactsLocation)WebSite.parameters.json$(artifactsLocationSasToken)'
    overrideParameters: '-_artifactsLocation $(artifactsLocation) -_artifactsLocationSasToken "$(artifactsLocationSasToken)"'
    deploymentMode: 'Incremental'

Where did you get AzureResourceManagerTemplateDeployment@3 from? I'm not able to find this one.