A Microsoft offering that enables tracking of cloud usage and expenditures for Azure and other cloud providers.
Hi mikky
Sorry to hear you lost that VM! The good news is Azure gives you several ways to guard against accidental deletions going forward. Here’s what you can do:
1.Apply Resource Locks
• Go to your resource group (or directly to the VM) in the Azure portal, choose “Locks,” and add a “CanNotDelete” lock.
• This prevents anyone (even subscription owners) from deleting locked resources unless they first remove the lock.
2.Use Role-Based Access Control (RBAC)
• Scope deletion rights only to the people who really need them. For example, give most team members the “Virtual Machine Contributor” role (which can’t delete the resource group) instead of “Owner.”
• Audit or remove any overly permissive custom roles.
3.Enable Azure Backup with Soft-Delete
• Create a Recovery Services vault, configure VM backups, and enable soft-delete.
• Even if someone stops protection and deletes backup data, Azure retains recovery points for 14 days and you can undelete them.
4.Lock Managed Disks or Snapshots
• If your VM uses managed disks, you can place a “CanNotDelete” lock directly on the disk resource.
• Alternatively, schedule incremental snapshots of your disks to give you a restore point.
5.(Optional) Audit with Azure Policy
• Use a built-in policy like “Add resource locks to resources” or “Resource group should have a lock” to enforce your company’s guardrails at scale.
Putting these in place will give you multiple safety nets: you’ll need the right RBAC permissions to delete, you’ll have to consciously remove a lock, and even if something slips through, you’ll still have backups and snapshots to recover from.
Reference:
https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/lock-resources?tabs=json
Please let me know if you face any challenge here, I can help you to resolve this issue further
Provide your valuable Comments.
Please do not forget to "Accept the answer” and “upvote it” wherever the information provided helps you, this can be beneficial to other community members.it would be greatly appreciated and helpful to others.