Hello ANIMESH
Thank you for posting your query on Microsoft Q&A platform.The issue occurs because restoring a VM from a Recovery Services vault requires write permissions on the target resource group, not just on the vault. Even if the user has a Contributor role at the subscription level via PIM, the restore can fail due to one of these reasons:
- Deny Assignments or Locks
- Azure RBAC deny assignments override any allowed permissions. If a deny assignment exists at the subscription or resource group level, it will block
Microsoft.Compute/virtualMachines/write. - Resource locks (Read-only or CanNotDelete) on the target resource group also prevent VM creation.
- Azure RBAC deny assignments override any allowed permissions. If a deny assignment exists at the subscription or resource group level, it will block
- PIM Activation Scope or Session
- The user must activate the Contributor role for the correct scope (subscription) and refresh their session after activation. If the token is stale, permissions won’t apply.
- Custom Role via PIM
- If a custom role was assigned instead of the built-in Contributor, verify it includes
Microsoft.Compute/*actions.
- If a custom role was assigned instead of the built-in Contributor, verify it includes
As a workaround try below checks and let me know if it is helpfull.
- Verify the restore destination scope: From the restore wizard, note the target RG (often named
AzureBackupRG_<region>_<n>). Ensure the PIM user has write access there and that no locks exist.
Reference: https://learn.microsoft.com/en-us/azure/backup/backup-azure-arm-restore-vms
- Check for deny assignments (blocks even with Contributor).
- Portal → Subscriptions → Access control (IAM) → Deny assignments
- Portal → Target RG → Access control (IAM) → Deny assignments If a deny blocks Compute/Network/Storage writes, remove/adjust the source (e.g., deployment stack).
Reference: https://learn.microsoft.com/en-us/azure/role-based-access-control/deny-assignments?tabs=azure-portal
- Remove resource locks that block writes.
- Portal → Target RG → Locks → remove Read‑only / CanNotDelete as appropriate.
Reference: https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/lock-resources?tabs=json
- Re‑activate PIM correctly and refresh the session.
- Activate Contributor at the subscription scope (or the RG scope you’re restoring to).
- After activation, sign out/in of Portal (or
az loginagain) and retry so the token reflects the active role.
Reference: https://learn.microsoft.com/en-us/azure/role-based-access-control/role-assignments-eligible-activate
- Confirm the role definition: If using a custom role, ensure required actions exist (Compute/Network/Storage writes).
Reference: https://learn.microsoft.com/en-us/azure/backup/backup-rbac-rs-vault
Note on Backup security controls (MUA/Resource Guard): These protect critical operations (stop protection, delete restore points) and are not typically the cause of VM create failures. If you have enabled MUA and are attempting a guarded operation, follow Resource Guard guidance.
The VM restore failed because the PIM‑activated user didn’t have effective write permission at the restore destination due to either a deny assignment or a resource lock, or because the PIM activation scope/session wasn’t applied. Fix: Identify the target RG, remove any deny assignments or locks that block writes, re‑activate PIM at subscription scope and refresh the session, and verify that the role (built‑in or custom) includes Microsoft.Compute/virtualMachines/write and related actions.
So, please share the exact target RG and whether any deny assignments/locks are present?
Thanks,
Suchitra.