Recovery services vault cannot be deleted as there are existing resources within the vault

Vault Cannot Be Deleted As There Are Existing Resources Within The Vault

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.

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.

cannot delete the backup vault as there are existing backup instances or backup policies in the vault.

Then I clicked on the Yes button for the confirmation

recovery services vault cannot be deleted as there are backup items still present in soft delete state

I got the below Vault deletion error as “Vault Cannot Be Deleted As There Are Existing Resources Within The Vault,” as shown below.

recovery services vault cannot be deleted as there are existing resources within the vault.

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.

recovery services vault cannot be deleted as there are backup items still present in soft delete state.

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.

delete recovery services vault

You can see below this is the Virtual Machine backup instance that is attached to the Azure Recovery Services vault.

recovery services vault soft delete

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.

how to delete recovery service vault in azure

Now click on the Stop Backup button to confirm the Stop Backup functionality.

recovery service vault soft delete

Now, you can see the stopping backup functionality was completed successfully.

how to delete recovery services vault

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

azure recovery services vault soft delete

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.

azure recovery services vault soft delete

You can see below that it successfully deleted the backup data for the virtual machine.

you need to delete the recovery services vault

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.

deleting a recovery services vault

You can see below that the Backup items (Azure Virtual Machine) are in a soft delete state.

force delete recovery services vault

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.

disable soft delete azure key vault

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.

how to disable soft delete azure key vault

Now, the settings are updated.

azure soft delete option disable

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.

Azure soft delete disable

Click on the Undelete button to confirm the undelete functionality.

soft delete azure vm

Now, if you try deleting the backup data, you can delete the backup data without any issues.

disable soft delete azure backup

To verify, you can see below the backup data is deleted successfully.

how to disable soft delete azure backup

Since no backup data is present for the Azure Virtual Machine, you can now try deleting the Azure Recovery Services vault without any issue.

Azure turn off soft delete

Click on the Yes button to confirm the Deletion process

Azure turn off soft delete option

You can see below the Recovery Services vault was successfully deleted without any issues.

azure backup disable soft delete

To confirm, you can see below that no recovery services vault is present.

recovery services vault disable soft delete

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

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.