无法删除Azure存储账户:创建状态停滞2天,删资源组也报错求助
问题描述
尝试通过Azure CLI删除存储账户时失败,执行命令:
az storage account delete --ids /subscriptions/00000000-0000-0000-0000-0000000000/resourceGroups/foo-rg/providers/Microsoft.Storage/storageAccounts/foostorageaccount --yes
收到错误提示:
(StorageAccountInCreating) Cannot delete the storage account while it is being created. Please retry after the storage account is fully created. Code: StorageAccountInCreating Message: Cannot delete the storage account while it is being created. Please retry after the storage account is fully created.
该异常状态已持续2天,尝试删除整个资源组也返回相同错误。
解决方法
使用ARM模板强制清理
利用ARM部署的Complete模式,删除资源组内未在模板中定义的所有资源,包括卡住的存储账户:- 创建模板文件
force-delete.json:
{ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "resources": [] }- 执行部署命令(确认资源组仅用于测试后操作):
az deployment group create --resource-group foo-rg --template-file force-delete.json --mode Complete- 创建模板文件
通过PowerShell尝试删除
执行PowerShell命令,尝试绕过CLI的状态校验:Remove-AzStorageAccount -ResourceGroupName foo-rg -Name foostorageaccount -Force提交Azure支持工单
若上述方法无效,直接在Azure门户提交支持工单,选择"资源管理"->"资源删除失败"类别,提供存储账户ID、错误信息及问题持续时间,后台支持团队可清理异常状态的资源。
内容的提问来源于stack exchange,提问作者Metro
相关产品推荐
相关产品推荐

