Azure VM snapshot using powershell

santosh llc 41 Reputation points
2021-09-11T20:05:35.547+00:00

I would like to automate the creating VM's snapshots and deleting snapshots for multiple VM's on one go. is it possible to achieve this using PowerShell or azure cli?

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

1 answer

Sort by: Most helpful
  1. Leon Laude 85,651 Reputation points
    2021-09-11T21:10:06.763+00:00

    Hi @santosh llc ,

    Yes this is doable for example with Azure PowerShell or Azure CLI, please refer to the official documentations below for achieving this with Azure PowerShell:

    Back up Azure VMs
    https://learn.microsoft.com/en-us/azure/backup/backup-azure-vms-automation#back-up-azure-vms

    Soft delete for Azure Backup - Permanently deleting soft deleted backup items
    https://learn.microsoft.com/en-us/azure/backup/backup-azure-security-feature-cloud#using-azure-powershell

    Here's also a great blog post on automating Azure VM backups with Azure PowerShell:
    Automate Backup For Azure VMs using PowerShell for Azure Backup

    ----------

    If the reply was helpful please don't forget to upvote and/or accept as answer, thank you!

    Best regards,
    Leon

    0 comments No comments