Forcing Delete of Azure Recovery Services Vault

When trying to delete a Recovery Services vault, you can run into issues with trying to actually delete the vault from the tenant – to solve this issue, you’ll have to use the CLI and Azure CLI to do this.

Before starting, make sure to disable soft delete within the vault as well, and then delete any currently existing soft delete items.

#login to tenant
az login

#get the item's container and item name
az backup item list --vault-name VAULT_NAME --resource-group RESOURCE_GROUP

#disable protection
az backup protection disable --container-name "CONTAINER_NAME" --delete-backup-data true --item-name "ITEM_NAME" --resource-group RESOURCE_GROUP --vault-name VAULT_NAME --yes --backup-management-type AzureIaasVM

#get list of policies
az backup policy list --vault-name VAULT_NAME --resource-group RG

#delete each policy
az backup policy delete --name POLICY_NAME --vault-name VAULT_NAME --resource-group RG

#delete vault
az backup vault delete --name VAULT_NAME --resource-group RG

Leave a Reply

Your email address will not be published. Required fields are marked *