我正在通过资源组中的Azure DevOps(ARM模板部署)任务部署ARM模板(Web应用程序)。在执行部署时出现以下错误:
##[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.
我去了活动日志以检查错误根。它来自“资源”下面的“连接字符串”和“ slotconfignames”部分:
"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"]
}
}
]
答案 0 :(得分:0)
我建议您安装AzureRM for Powershell,并在提交并在Azure Devops管道中运行之前使用Test-AzureRmResourceGroupDeployment函数在本地测试ARM模板。因此,您可以对模板进行故障排除并找出问题所在。测试时,您应该有详细信息。