Cannot delete a Restore Point in the failed status

oc 0 Reputation points
2023-06-06T14:53:06.2566667+00:00

After testing creating a VM with Azure Backup enabled, I tried deleting all the resources created along with it. One of the resources is a Restore Point Collection. There are currently two restore points in the collection. Both are in the "Failed" provisioning status. When I try to delete these restore points, I get an error message saying that they can't be deleted. If I click on the message, which appears as a notification in the azure portal, I am taken to page where it says the resource can't be found, but they are still listed in the portal. There are no locks on the restore points or the collection. All other resources belonging to the VM have been deleted, including the disks. Is there a way to delete these restore points?

Azure Backup
Azure Backup
An Azure backup service that provides built-in management at scale.
1,301 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Luke Murray 11,241 Reputation points MVP
    2023-06-09T21:07:26.05+00:00

    You can try to use PowerShell. This is an excerpt from a script I have been working on to do with Azure Backup:

    Note: This will delete the Azure Backup vault - but take a look at:

     Undo-AzRecoveryServicesBackupItemDeletion
    

    https://learn.microsoft.com/en-us/powershell/module/az.recoveryservices/undo-azrecoveryservicesbackupitemdeletion?view=azps-10.0.0

    
                ## Checks to see if a Recovery Services Vaults exists, the Recovery Services Vault and backups need to be deleted first.
                $RSV = Get-AzRecoveryServicesVault | Where-Object { $_.ResourceGroupName -in $ResourceGroupsfordeletion.ResourceGroupName }
                if ($null -ne $RSV) {
    
                    ForEach ($RV in $RSV) {
                        Write-Output  "Backup Vault deletion supports deletion of Azure VM backup vaults ONLY currently."
                        #Credit to Wim Matthyssen for reference in the backup section of the script - https://wmatthyssen.com/2020/11/17/azure-backup-remove-a-recovery-services-vault-and-all-cloud-backup-items-with-azure-powershell/
                        Set-AzRecoveryServicesVaultProperty -Vault $RV.ID -SoftDeleteFeatureState Disable
                        Set-AzRecoveryServicesVaultContext -Vault $RV
                        $containerSoftDelete = Get-AzRecoveryServicesBackupItem -BackupManagementType AzureVM -WorkloadType AzureVM | Where-Object { $_.DeleteState -eq "ToBeDeleted" }
     
                        foreach ($item in $containerSoftDelete) {
                            Undo-AzRecoveryServicesBackupItemDeletion -Item $item  -Force -Verbose
                        }
    
                        $containerBackup = Get-AzRecoveryServicesBackupItem -BackupManagementType AzureVM -WorkloadType AzureVM  | Where-Object { $_.DeleteState -eq "NotDeleted" }
                        foreach ($item in $containerBackup) {
                            Disable-AzRecoveryServicesBackupProtection -Item $item -RemoveRecoveryPoints -Force -Verbose
                        }
                        Remove-AzRecoveryServicesVault -Vault $RV -Verbose
    
                    }
    
                }
    
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.