Skip to content

[AVM Module Issue]: Unable to delete VM associated with Immutable recovery services vault #214

@robsissons-contino

Description

@robsissons-contino

Check for previous/existing GitHub issues

  • I have checked for previous/existing GitHub issues

Issue Type?

I'm not sure

(Optional) Module Version

No response

(Optional) Correlation Id

No response

Description

When we have a recovery services vault with immutability configured (unlocked) and use the AVM to associate the VM with a policy on the vault we are unable to remove the VM from our Terraform configuration whilst there are recovery points available in the RSV.

Error:

deleting Resource: (ResourceId
"/subscriptions/***/resourceGroups/rg-xxx/providers/Microsoft.RecoveryServices/vaults/rsv-xxx/backupFabrics/Azure/protectionContainers/iaasvmcontainer;iaasvmcontainerv2;rg-xxxx;vm-xxxx/protectedItems/VM;iaasvmcontainerv2;rg-xxx;vm-xxxx"
/ Api Version "2024-10-01"): GET
https://management.azure.com/subscriptions/***/resourceGroups/rg-xxx/providers/Microsoft.RecoveryServices/vaults/RSV-xxx/backupOperations/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx
--------------------------------------------------------------------------------
RESPONSE 200: 200 OK
ERROR CODE: UserErrorDeleteBackupItemOnImmutableItem
--------------------------------------------------------------------------------
{
  "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx",
  "name": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx",
  "status": "Failed",
  "startTime": "2025-09-18T14:22:18.3983532Z",
  "endTime": "2025-09-18T14:22:18.3983532Z",
  "error": {
    "code": "UserErrorDeleteBackupItemOnImmutableItem",
    "message": "The Backup Item(s) cannot be deleted since it has active recovery points and the selected Vault is an immutable vault."
  }
}
--------------------------------------------------------------------------------

Confirmed with Microsoft support that deletion of a virtual machine with recovery points in an RSV is possible. Also tried disabling the backup protection using AZ CLI and re-running - same error.

Finally tested by removing the VM through the portal to confirm that this should be possible and can confirm that the VM can be deleted and the recovery points remain available in the immutable vault.

Has anyone else faced this issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions