How delete the left azure vm restore point, the vm and recovery service vault is already deleted

Amit Chakarvarty 20 Reputation points

I have created a VM in Azure and enabled backup. This morning I deleted the VM, and the recovery service vault I created for my backups.

Deletion of the VM and recovery service vault was successful. However, a restore point collection has been left behind which I cannot delete. Getting below error:

👁 User's image

  1. Amit Chakarvarty 20 Reputation points

    Also i don't have the Microsoft support so it is not allowing me to create support ticket.

    When i'm going to create the ticket it is asking to purchase the support plan.

    So how to resolve this asap, because it is incurring the charges.


Sign in to comment

Answer accepted by question author

Siva shunmugam Nadessin 10,895 Reputation points Microsoft External Staff Moderator

Hello Amit Chakarvarty,

Thank you for reaching out to the Microsoft Q&A forum.  

When investigated it looks like you’ve got an orphaned Azure Backup restore point sitting out there, even though the VM and vault show as deleted. What’s happening is that Azure Backup’s soft-delete (and the dependency chain) is holding onto those recovery points, so the “Delete” operation never actually goes through. Here’s a quick way to clean it up without needing an Azure Support ticket:

Re-create (or identify) the Recovery Services vault

• If you’ve already deleted the vault, spin up a new one in the same resource group and region using the exact same name. This gives you something you can target with PowerShell/CLI.

Connect & set context

Connect-AzAccount
Select-AzSubscription -SubscriptionName "YourSubscription"
$vault = Get-AzRecoveryServicesVault -Name "YourVaultName"
Set-AzRecoveryServicesVaultContext -Vault $vault

Find the orphaned backup item & recovery points

# List containers for Azure VMs
$containers = Get-AzRecoveryServicesBackupContainer -ContainerType AzureVM
# (filter by the old VM name or GUID if you still see it)
$item = Get-AzRecoveryServicesBackupItem -Container $containers |
        Where-Object { $_.FriendlyName -like "*myvm*" }
 
# List recovery points for that item
$rps = Get-AzRecoveryServicesBackupRecoveryPoint -Item $item

Purge all recovery points

# This will delete every recovery point for that item
foreach($rp in $rps) {
  Remove-AzRecoveryServicesBackupRecoveryPoint -Item $item `
    -RecoveryPoint $rp -Force -Verbose
}

Stop protection & delete the (now-empty) backup item

Disable-AzRecoveryServicesBackupProtection `
  -Item $item -RemoveRecoveryPoints -Force

Finally, delete the vault itself

Remove-AzRecoveryServicesVault -Vault $vault -Force

Once that’s done, the orphaned restore point collection will be gone, and you’ll stop incurring charges.

Let me know if any further queries - feel free to reach out!

Documents Referred:

• Delete backup data for an Azure VM (stop protection & remove recovery points): https://learn.microsoft.com/azure/backup/backup-azure-manage-vms#delete-backup-data

• Delete an Azure Backup Recovery Services vault (PowerShell & CLI): https://learn.microsoft.com/azure/backup/backup-azure-delete-vault?tabs=powershell https://learn.microsoft.com/azure/backup/backup-azure-delete-vault?tabs=cli

• Force-delete a Recovery Services vault (all dependencies) via PowerShell: https://learn.microsoft.com/azure/site-recovery/delete-vault#use-powershell-to-force-delete-the-vault

  1. Siva shunmugam Nadessin 10,895 Reputation points Microsoft External Staff Moderator

    Hello Amit Chakarvarty,

    Just checking in to see if the solution shared above help you to resolve your issue. please reach out to us If you have any further questions.

    Thanks

  2. Amit Chakarvarty 20 Reputation points

    Hi Siva,

    Thanks for the solution you mentioned above i have tried the above mentioned script and it worked.

    Thank you

  3. Siva shunmugam Nadessin 10,895 Reputation points Microsoft External Staff Moderator

    Amit Chakarvarty, Kindly 👁 User's image
    & up-vote 👁 User's image
     this can be beneficial to other community members.

  4. Bharath Y P 9,730 Reputation points Microsoft External Staff Moderator

    Hello Amit Chakarvarty, If the information shared by Siva was helpful. If so, please consider accepting the answer and giving it an upvote.

    If you have any further questions or need additional clarification, feel free to reach out. Thanks!


Sign in to comment

1 additional answer

  1. Stanislav Zhelyazkov 29,586 Reputation points MVP Volunteer Moderator

    Hi,

    The restore point most likely has a resource lock. Check for such and delete it. After that you should be able to delete the restore point as well.

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    1. Amit Chakarvarty 20 Reputation points

      Hi,

      Thanks for the response but there is no resource lock.

    2. Stanislav Zhelyazkov 29,586 Reputation points MVP Volunteer Moderator

      is there an option to click on the failed activity and see more information?

    3. Amit Chakarvarty 20 Reputation points

      Please find the attached screenshot for reference:👁 User's image

    4. Stanislav Zhelyazkov 29,586 Reputation points MVP Volunteer Moderator

      Can you run:

      Revoke-AzDiskAccess -ResourceGroupName '<RG_Name>' -DiskName '<Disk_Name>'
      

      This is for the disk. Is by any chance the disk of the VM still present?

      May be you can also try:

      Revoke-AzSnapshotAccess -ResourceGroupName 'ResourceGroup01' -SnapshotName 'Snapshot01'
      

      This is for the snapshots. May be you have deleted the disks and the vault but the snapshots are still present and causing this. The snapshots are usually present in another resource group in the same subscription where the VM is.

      If any of these revoke the access you should be able to delete the restore point.


    Sign in to comment
Sign in to answer

Your answer