Recently, I got a requirement to create a snapshot of Azure VM using PowerShell. I did it successfully with the steps below.
How to create a snapshot of Azure Virtual Machine using PowerShell
You can use the below PowerShell script to create the snapshot of the Azure Virtual machine.
$myvm = Get-Azvm -ResourceGroupName DemoVM -Name TSINFOVM
$snapconfDetails = New-AzSnapshotConfig -SourceUri $myvm.StorageProfile.OsDisk.ManagedDisk.Id -Location “East US” -CreateOption copy
New-AzSnapshot -Snapshot $snapconfDetails -SnapshotName tsinfosnap -ResourceGroupName DemoVMOnce we have executed the above script, you can see below the snapshot of the Azure VM has been created successfully.

The output looks like the below
ResourceGroupName : DemoVM
ManagedBy :
Sku : Microsoft.Azure.Management.Compute.Models.SnapshotSku
TimeCreated : 12/10/2020 12:53:26 AM
OsType : Windows
HyperVGeneration :
CreationData : Microsoft.Azure.Management.Compute.Models.CreationData
DiskSizeGB : 127
DiskSizeBytes : 136367308800
UniqueId : 25f77a5b-0bb9-4b04-955e-016da959d351
EncryptionSettingsCollection :
ProvisioningState : Succeeded
Incremental : False
Encryption : Microsoft.Azure.Management.Compute.Models.Encryption
Id : /subscriptions/1cdf4300-dee5-4518-9c9c-feaa72a5cbd1/res
ourceGroups/DemoVM/providers/Microsoft.Compute/snapshot
s/tsinfosnap
Name : tsinfosnap
Type : Microsoft.Compute/snapshots
Location : eastus
Tags : {}
NetworkAccessPolicy : AllowAll
DiskAccessId :
You can also check out how to snapshot Azure VM using Azure Portal.
You may also like following the articles below
Conclusion
This article discussed the quick steps to create a snapshot of Azure VM using PowerShell. Thanks a lot for reading this article !!!

I am Rajkishore, and I am a Microsoft Certified IT Consultant. I have over 14 years of experience in Microsoft Azure and AWS, with good experience in Azure Functions, Storage, Virtual Machines, Logic Apps, PowerShell Commands, CLI Commands, Machine Learning, AI, Azure Cognitive Services, DevOps, etc. Not only that, I do have good real-time experience in designing and developing cloud-native data integrations on Azure or AWS, etc. I hope you will learn from these practical Azure tutorials. Read more.
