I am deploying ARM templates (Web Apps) via Azure DevOps (ARM Template Deployment) task in resource group. While executing deployment below error is coming :
##[section]Starting: ARM Template deployment: Resource Group scope
==============================================================================
Task : ARM template deployment
Description : Deploy an Azure Resource Manager (ARM) template to all the deployment scopes
Version : 3.1.18
Author : Microsoft Corporation
Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/deploy/azure-resource-group-deployment
==============================================================================
ARM Service Conection deployment scope - Subscription
Checking if the following resource group exists: xyz.
Resource group exists: true.
Creating deployment parameters.
Starting template validation.
Deployment name is azuredeploy-xyz
Template deployment validation was completed successfully.
Starting Deployment.
Deployment name is azuredeploy-xyz
There were errors in your deployment. Error code: DeploymentFailed.
##[error]At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details.
##[error]Details:
##[error]NotFound: {
"error": {
"code": "BadRequest",
"message": ""
}
}
##[error]Task failed while creating or updating the template deployment.
##[section]Finishing: ARM Template deployment: Resource Group scope.
I went to activity log to check error root. It is coming from 'connectionstrings' and 'slotconfignames' sections under 'resources' as below :
"resources": [
{
"apiVersion": "2015-08-01",
"name": "connectionstrings",
"type": "config",
"location": "[parameters('location')]",
"dependsOn": [
"[resourceId('Microsoft.Web/Sites/Slots', parameters('webSiteName'), 'stage')]"
],
"properties": {
"ConnectionString1": {
"value": "parameters('ConnectionString1Data')",
"type": "Custom"
},
"ConnectionString2": {
"value": "parameters('ConnectionString2Data')",
"type": "SQLAzure"
}
}
},
{
"apiVersion": "2015-08-01",
"name": "slotconfignames",
"type": "config",
"location": "[parameters('location')]",
"dependsOn": [
"[resourceId('Microsoft.Web/Sites/Slots', parameters('webSiteName'), 'stage')]"
],
"properties": {
"connectionStringNames": [ "ConnectionString1" ,"ConnectionString2"]
}
}
]
Only list resources that are deployed in this template.
. Since your slot already exists, you can try removing it fromdependsOn
. – stackoverflowusrone