In this Azure Article, we will discuss how to fix the error, ” recovery services vault cannot be deleted as there are existing resources within the vault. “. I got this error when deleting one of the Recovery Services vaults.
Table of Contents
Recovery services vault cannot be deleted as there are existing resources within the vault
Recently, I was trying to clear the unused Azure resources to reduce the cost. When I tried to delete one of the Azure Recovery Services vaults, it didn’t allow me to delete it, and I got this error.
The complete error message was as below
Vault cannot be deleted as there are existing resources within the vault: Please ensure all containers have been unregistered from the vault and all private endpoints associated with the vault have been deleted, and retry the operation. For more details, see https://aka.ms/AB-AA4ecq5
I followed the below steps to delete the Azure Recovery Service vault. My Azure Recovery Service vault name was vault938, and I was trying to delete it.
To delete the Azure recovery services vault, Navigate to the Recovery Services vault and click on the Recovery Services vault you want to delete. On the Recovery Services vault page, click on the Delete button.
Then I clicked on the Yes button for the confirmation
I got the below Vault deletion error as “Vault Cannot Be Deleted As There Are Existing Resources Within The Vault,” as shown below.
Now, the reason I got this error is that there is a Backup item for the Azure Virtual Machine that is attached to this Recovery Services vault. To check that, click the Backup items link under Protected items on the Recovery Services vault page.
After clicking on the Backup items, you can see that the Azure Virtual Machine has a backup item count of 1. Click on the Azure Virtual Machine.
You can see below this is the Virtual Machine backup instance that is attached to the Azure Recovery Services vault.
Delete the Backup Items(Azure Virtual Machine) to fix this error.
To delete this, select the Azure Virtual Machine backup instance, click on the three dots (…), or right-click on it for the same options, and then click on the stop backup option.
Now click on the Stop Backup button to confirm the Stop Backup functionality.
Now, you can see the stopping backup functionality was completed successfully.
Now, after stopping the backup, select the Azure Virtual Machine backup instance, click on the three dots (…), or you can right-click on that for the same options and then click on the Delete backup data option
Type the name of the Backup item and then click on the Delete button to delete the Backup data.
Note: An important thing to note here is the name of the Backup Item is case sensitive and you need to enter exactly the same name of the Backup Data as it is.
You can see below that it successfully deleted the backup data for the virtual machine.
See here. The restore points for this backup item have been deleted and retained in the soft delete state and will be available for 13 more days to recover. After which they will be permanently deleted. That means even though you deleted the Backup data, it is still available for 13 more days in a soft delete state, and then, afterward, it will be deleted permanently.
You can see below that the Backup items (Azure Virtual Machine) are in a soft delete state.
Now again, if you try to delete the Azure Recovery Services vault, it will not allow you to delete it, and you will get the below error
Recovery Services vault cannot be deleted as there are backup items in the soft-deleted state in the vault. The soft-deleted items are permanently deleted after 14 days of the delete operation. Please try vault deletion after the backup items are permanently deleted, and there is no item in the soft-deleted state left in the vault. For more information, refer
Recovery services vault cannot be deleted as there are existing resources within the vault [Solved]
So now you have two options to delete the Azure Recovery Services vault to fix the error “Vault Cannot Be Deleted As There Are Existing Resources Within The Vault”
Option 1: You need to wait for 14 days, and then afterward, it completely deletes the soft delete backup data automatically. After that, you can try deleting the Azure Recovery Services vault. It will allow you to delete this time without any issues.
Option 2: If you want to permanently delete the soft delete data immediately instead of waiting 14 days, follow the steps below. Then, you can delete the Azure Recovery Services vault immediately without any issues.
The first step is disabling the Azure Portal’s soft delete option. On the Recovery Services vault page, click Properties under Settings and then click the Security Settings —> Update link.
On the Security Settings page, Select the Disabled button for the Soft Delete (For Azure Virtual Machines) option and then click on the Save button to update the changes.
As mentioned below, once you disable the Soft delete option, all future deletes will be immediate and will not have soft delete protection.
Now, the settings are updated.
Now the Soft Delete (For Azure Virtual Machines) option is disabled, so on the next step, select the Soft Delete backup data and click on the three dots (…), click on the Undelete option.
Click on the Undelete button to confirm the undelete functionality.
Now, if you try deleting the backup data, you can delete the backup data without any issues.
To verify, you can see below the backup data is deleted successfully.
Since no backup data is present for the Azure Virtual Machine, you can now try deleting the Azure Recovery Services vault without any issue.
Click on the Yes button to confirm the Deletion process
You can see below the Recovery Services vault was successfully deleted without any issues.
To confirm, you can see below that no recovery services vault is present.
This is how we can fix the error “Vault Cannot Be Deleted As There Are Existing Resources Within The Vault” and how we can delete an Azure recovery services vault using the Azure Portal.
You may also like going through the tutorials below
- How to move recovery services vault to another subscription
- Azure Recovery Services Vault VS Backup Vault
Conclusion
In this tutorial, we discussed how to fix the error “Recovery Services vault cannot be deleted as there are existing resources within the vault. “Thanks for reading this article; I hope it helps you.
I am Bijay, a Microsoft MVP (10 times) having more than 17 years of experience in the software industry. During my IT career, I got a chance to share my expertise in SharePoint and Microsoft Azure, like Azure VM, Azure Active Directory, Azure PowerShell, etc. I hope you will learn from these Azure tutorials. Read more