Azure Backup has a little feature for backed up Virtual Machines called Soft Delete. This feature is, at the time of writing only available in the West Central US region, but don’t let that stop you from reading since it might be on the way to other regions as well. In short it allows you to restore a backup even after it has been deleted.
Although this feature is mainly focused on security concerns like accidentally or advisedly and with bad intentions deleting a backup. We’ll highlight another possible use case for this feature. This being the processing of a change request for phasing out a VM the customer no longer thinks he needs.
So we got this change request to phase out a VM named AZF-VM-US01. We’ve shut down the VM, removed the VM resources and are now removing the backup items per the customer’s request. We’ve entered the Recovery Services Vault containing this VM backup.
By opening the backup config for this VM by clicking on it we get an option to stop the backup.
Once we click “Stop backup” we’re able to tell if the backup data should be deleted or retained and give a reason for stopping the backup.
Now the customer calls telling us the VM apparently still contained important data which people were still making use of. Could we still do something in this scenario where you’ve told Azure to delete the backup data? Yes! Once we finished the previous step you’ll now see a red icon next to the backup item you’ve just told Azure to delete, this being the “soft deleted” icon.
Open the VM backup config and you’ll see a notification about the restore points still being in a soft delete state plus a button called “Undelete”
Once you click that button you’ll get a screen stating what will happen next if you press “Undelete” once more. It will undelete all restore points and put the backup of this VM in the “Stop protection with retain data” state.
Do note that recovery points that have already expired (passed their retention) will be removed once you would resume the backup. So if this VM was to be kept for a longer period of time you’d select “Resume backup” only after restoring the VM to its original state. Once you select “Resume” the expired recovery points will be deleted.
Soft Delete adds an extra 14 days retention on the deleted recovery points, which comes with no extra costs and is built-in to a Recovery Service Vault by default. It is a great way to recover from accidental or malicious deletion of VM backup items.