Today when I am doing cleaning for the azure resources that I don’t need it to reduce the cost, I tried to remove Resource Group contain Recovery Service vault Services but it gives me error

Failed to delete resource group prodresouorcegroup: Deletion of resource group ‘prodresouorcegroup’ failed as resources with identifiers ‘Microsoft.RecoveryServices/vaults/elmasryvmbackupvault1’ could not be deleted

Then when I tried to remove the recovery services vault it gives me another error

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. For instructions, see https://aka.ms/AB-AA4ecq5

After some Google Search I know the correct steps for deleting  Azure Recovery services vault

  • Open the recovery services vault
  • On the left side click on Backup Item you will find a list by the items like VM that is protected by the backup vault
  • Click on protect the item you will find the backup Item detail
  • Right-click on it and do Stop backup
  • After task completed right-click on the backup item and select Delete backup data

IF you go now and try to delete the Recovery service vault it will give you a new error the meaning of it when you delete the backup item the backup taken for this item will be in soft-deleted for 14 days and you can’t remove the recovery services during this period.

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, refer https://aka.ms/SoftDeleteCloudWorkloads. The registered items are 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, refer https://aka.ms/SoftDeleteCloudWorkloads.

After another search, I found that we should unregister the storage account from the recovery services vault

  • Open recovery services vault
  • In the left side click on backup Infrastructure
  • Then select Storage account you will find the storage account registered with this recovery services vault
  • Right-click and select unregistered
  • After this you remove the recovery services vault easily

Resources

Keep Following Me

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.