
The code sample provided creates a snapshot in the same resource group and within the same region as your source VM. This example assumes that you have a VM called myVM in the myResourceGroup resource group. Get-AzSnapshot `įollow these steps to take a snapshot with the az snapshot create command and the -source-disk parameter. Use the Get-AzSnapshot cmdlet to verify that your snapshot exists. For a list of regions that support availability zones, see Azure regions with availability zones. If you want to store your snapshot in zone-resilient storage, you must create the snapshot in a region that supports (./availability-zones/az-overview.md and include the -SkuName Standard_ZRS parameter. We recommend that you store your snapshots in standard storage instead of premium storage whatever the storage type of the parent disk or target disk. By default, the snapshot uses locally redundant standard storage. In the example, the snapshot is of the OS disk. $vm = Get-AzVM `Ĭreate the snapshot configuration. Use the Get-AzVM cmdlet to get the VM containing the VHD you want to copy. Update the values to reflect your environment. You can then use the New-AzSnapshot cmdlet to take a snapshot of the disk. The code sample provided creates a snapshot in the same resource group and within the same region as your source VM.įirst, you'll use the New-AzSnapshotConfig cmdlet to create a configurable snapshot object. This example requires that you use Cloud Shell or have the Azure CLI installed.įollow these steps to take a snapshot with the New-AzSnapshotConfig and New-AzSnapshot cmdlets. Otherwise, default settings are used for your snapshot.


