如何解决Arm模板部署失败,一个特定的存储帐户出现409错误
我使用手臂模板来部署存储帐户。但是,我收到一条错误消息:StorageAccountAlreadyExists:名为xxx的存储帐户已经存在。
我的发布管道设置为增量,因此不应真正显示此错误。
我将存储帐户名称更改为一个新名称,不仅它第一次起作用,而且我可以继续部署相同的管道,而且不会抛出任何错误。
它似乎是此帐户专用的内容,但是我看不到任何特别的内容。我们使用的arm模板也很正常(之前我们从官方示例中得到的东西)。
{
"$schema": "http://schema.management.azure.com/schemas/2019-06-01/deploymentTemplate.json#","contentVersion": "1.0.0.0","parameters": {
"StorageDescriptor": {
"type": "string","defaultValue": "StorageAccount","metadata": {}
},"StorageAccountName": {
"type": "string","defaultValue": "[toLower(concat(parameters('StorageDescriptor'),resourceGroup().name))]","metadata": { "Description": "Override name for the storage account" }
},"StorageType": {
"type": "string","defaultValue": "Standard_LRS","allowedValues": [
"Standard_LRS","Standard_ZRS","Standard_GRS","Standard_RAGRS","Premium_LRS"
]
},"Environment": {
"type": "string","defaultValue": "PreProd","metadata": { "description": "PreProd or Prod" }
}
},"variables": {
},"resources": [
{
"name": "[parameters('StorageAccountName')]","type": "Microsoft.Storage/storageAccounts","location": "[resourceGroup().location]","apiVersion": "2019-06-01","dependsOn": [],"tags": {
"displayName": "Web Job Storage Account"
},"properties": {
"accountType": "[parameters('StorageType')]"
}
}
],"outputs": {
}
}
解决方法
即使您的发布渠道设置为增量,但每次部署时,存储帐户名称都必须是唯一的。请参阅:here。
,一个特定存储帐户的臂模板部署失败,出现409错误
您需要检查存储帐户属性是否已被其他人通过Azure / PowerShell门户更改,并且与ARM模板上指定的属性不同。
要解决此问题,请尝试导出模板并在Azure devops存储库中对其进行更新:
然后,我们可以根据需要更新此新导出的模板文件并进行部署。
作为测试,我可以继续部署相同的管道,并且不会抛出任何错误。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。