Delete Recovery Containers in Azure

While doing some clean-up of a collection of Azure resources, I came across difficulty when trying to delete Azure Site Recovery¬†resources. Specifically, when trying to delete the Recovery Services vault, I’d receive this ‘Vault deletion error’:

Vault deletion error message

Furthermore, when trying to use the portal to delete the existing containers, I would end up with a delay in the actual deletion of the containers. I ended up looking through Azure CLI does and finding a way to programmatically delete the containers.

First, find the subscription ID of your Azure tenant, and use the following command:

Next, connect to the Azure Recovery Vault using the Resource Group name and Vault name:

Finally, you can run the following command to delete a recovery container from the vault. Use this for each of the containers:

After deleting all the containers, you should be able to delete the Recovery vault without any issues.

Leave a Reply

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