I am attempting to execute an Pipeline which uses the ARM template deployment to execute pipelines to Azure
The yaml script is as follows:
- task: AzureResourceManagerTemplateDeployment@3
inputs:
deploymentScope: 'Resource Group'
azureResourceManagerConnection: 'NewAzureConnection'
subscriptionId: 'xxxxxx-xxxx-xxx-xxxxxxxx03'
action: 'Create Or Update Resource Group'
resourceGroupName: '$(ResourceGroupUAT)'
location: '$(Location)'
templateLocation: 'Linked artifact'
csmFile: '$(System.DefaultWorkingDirectory)/adf-xxxxabric-dev/ARMTemplateForFactory.json'
csmParametersFile: '$(System.DefaultWorkingDirectory)/adf-xxxxxx-dev/ARMTemplateParametersForFactory.json'
overrideParameters: '-factoryName $(DataFactoryUAT)'
deploymentMode: 'Incremental'
The full script is as follows:
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
trigger:
- adf_publish
pool:
vmImage: ubuntu-latest
steps:
- script: |
tree $(System.DefaultWorkingDirectory)
displayName: Show file structure of System.DefaultWorkingDirectory during a build
- task: AzurePowerShell@5
inputs:
azureSubscription: 'NewAzureConnection'
ScriptType: 'FilePath'
ScriptPath: '$(System.DefaultWorkingDirectory)/adf-xxxxx-xxxxx-dev/PrePostDeploymentScript.ps1'
ScriptArguments: '-armTemplate "$(System.DefaultWorkingDirectory)/adf-xxxx-xxxx-dev/ARMTemplateForFactory.json" -ResourceGroupName $(ResourceGroupUAT) -DataFactoryName $(DataFactoryUAT) -predeployment $true -deleteDeployment $false'
azurePowerShellVersion: 'LatestVersion'
- task: AzureResourceManagerTemplateDeployment@3
inputs:
deploymentScope: 'Resource Group'
azureResourceManagerConnection: 'NewAzureConnection'
subscriptionId: 'xxxxxx-xxxx-xxx-xxxxxxxx03'
action: 'Create Or Update Resource Group'
resourceGroupName: '$(ResourceGroupUAT)'
location: '$(Location)'
templateLocation: 'Linked artifact'
csmFile: '$(System.DefaultWorkingDirectory)/adf-xxxxabric-dev/ARMTemplateForFactory.json'
csmParametersFile: '$(System.DefaultWorkingDirectory)/adf-xxxxxx-dev/ARMTemplateParametersForFactory.json'
overrideParameters: '-factoryName $(DataFactoryUAT)'
deploymentMode: 'Incremental'
I when I run the pipeline it fails on the task: AzureResourceManagerTemplateDeployment@3 with the following error:
##[error]Failed to check the resource group status. Error: {“statusCode”:403}
Any thoughts on what is causing the error?
The ARM Template Settings are as follows: