Delete an Azure Backup Recovery Services vault

This article describes how to delete an Azure Backup Recovery Services vault. It contains instructions for removing dependencies and then deleting a vault.

Before you start

You can't delete a Recovery Services vault with any of the following dependencies:

  • You can't delete a vault that contains protected data sources (for example, IaaS VMs, SQL databases, Azure file shares).
  • You can't delete a vault that contains backup data. Once backup data is deleted, it will go into the soft deleted state.
  • You can't delete a vault that contains backup data in the soft deleted state.
  • You can't delete a vault that has registered storage accounts.

If you try to delete the vault without removing the dependencies, you'll encounter one of the following error messages:

  • Vault cannot be deleted as there are existing resources within the vault. Please ensure there are no backup items, protected servers, or backup management servers associated with this vault. Unregister the following containers associated with this vault before proceeding for deletion.

  • Recovery Services vault cannot be deleted as there are backup items in soft deleted state in the vault. The soft deleted items are permanently deleted after 14 days of delete operation. Please try vault deletion after the backup items are permanently deleted and there is no item in soft deleted state left in the vault. For more information, see Soft delete for Azure Backup.

Note

Before deleting a Backup protection policy from a vault, you must ensure that

  • the policy doesn't have any associated Backup items.
  • each associated item is associated with some other policy.

Delete a Recovery Services vault

Choose a client:

First, read the Before you start section to understand the dependencies and vault deletion process.

Note

Currently, Azure Backup CLI supports managing only Azure VM backups, so the following command to delete the vault works only if the vault contains Azure VM backups. You can't delete a vault using Azure Backup CLI, if the vault contains any backup item of type other than Azure VMs.

To delete existing Recovery Services vault, perform the following steps:

  • To stop protection and delete the backup data

    az backup protection disable --container-name
                             --item-name
                             [--delete-backup-data {false, true}]
                             [--ids]
                             [--resource-group]
                             [--subscription]
                             [--vault-name]
                             [--yes]
    

    For more information, see this article.

  • Delete an existing Recovery Services vault:

    az backup vault delete [--force]
                       [--ids]
                       [--name]
                       [--resource-group]
                       [--subscription]
                       [--yes]
    

    For more information, see this article

Next steps