Deleting Azure Recovery Services Vault failed
Azure Backup now provides security features to help protect backup data even after deletion.
Therefore you can’t just easily delete a recovery services vault and will run into an error when trying like shown below.
In my case actually I wanted to delete a resource group and its resources which one of them was a recovery services vault.
When just clicking below on Delete resource group I was running into the following error.
Failed to delete resource group. Deletion of resource group could not be deleted.
Trying to delete a Recovery Services vault
Therefore I wanted to first delete my recovery services vault which also failed like shown below.
So I was getting two errors why this vault couldn’t be just deleted, first soft delete is enabled on the vault and second there are protected items in the vault.
Disable soft delete
So to be able to delete this vault, first we need to disable soft delete on the vault, and then second we need to delete existing backup items in this vault before we can finally delete the vault itself.
In the Azure portal, go to your vault, and then go to Settings > Properties.
In the Properties pane, select Soft Delete and security settings and click on the Update link.
In the Security and soft delete settings pane, clear the required checkboxes to disable soft delete and finally click on Update.
Delete protected items in the vault
We also first need to delete all protected items by this vault. I was trying this also before but at this time soft delete was still enabled and therefore it wasn’t possible to delete them.
Perform stop backup and delete on all cloud and on premises backup items to proceed forward.
In my case as mentioned I was previously already trying to delete the backup but it failed because soft delete was enabled. So in this case we then first needed to execute an undelete to be able to trigger another Delete backup data.
Enter the name of the backup and select a reason.
This time I was able to delete the backup data because soft delete is now disabled.
No further items are protected from now on and this time I should be able to delete the recovery services vault.
Finally deleting the recovery services vault
On the recovery services vault blade we can click again on Delete.
Select Delete manually and select I wish to permanently delete the vault.
This time it works and the recovery services vault was successfully deleted.
Now I was also able to delete my resource group.
What is Soft delete for Azure Backup?
Concerns about security issues, like malware, ransomware, and intrusion, are increasing. These security issues can be costly, in terms of both money and data. To guard against such attacks, Azure Backup now provides security features to help protect backup data even after deletion.
One such feature is soft delete. With soft delete, even if a malicious actor deletes a backup (or backup data is accidentally deleted), the backup data is retained for 14 additional days, allowing the recovery of that backup item with no data loss. The additional 14 days of retention for backup data in the “soft delete” state don’t incur any cost to you.
Source: https://learn.microsoft.com/en-us/azure/backup/backup-azure-security-feature-cloud?tabs=azure-portal
What is a Recovery Services Vault?
A Recovery Services vault is a storage entity in Azure that houses data. The data is typically copies of data, or configuration information for virtual machines (VMs), workloads, servers, or workstations. You can use Recovery Services vaults to hold backup data for various Azure services such as IaaS VMs (Linux or Windows) and SQL Server in Azure VMs.
Recovery Services vaults support System Center DPM, Windows Server, Azure Backup Server, and more. Recovery Services vaults make it easy to organize your backup data, while minimizing management overhead.
Source: https://learn.microsoft.com/en-us/azure/backup/backup-azure-recovery-services-vault-overview
Links
Soft delete for Azure Backup
https://learn.microsoft.com/en-us/azure/backup/backup-azure-security-feature-cloud?tabs=azure-portalOverview of security features in Azure Backup
https://learn.microsoft.com/en-us/azure/backup/security-overviewRecovery Services vaults overview
https://learn.microsoft.com/en-us/azure/backup/backup-azure-recovery-services-vault-overview