Create a snapshot

Take a snapshot of an OS or data disk VHD for backup or to troubleshoot VM issues. A snapshot is a full, read-only copy of a VHD.

Use Azure portal to take a snapshot

  1. Sign in to the Azure portal.
  2. Starting in the upper left, click New and search for snapshot.
  3. In the Snapshot blade, click Create.
  4. Enter a Name for the snapshot.
  5. Select an existing Resource group or type the name for a new one.
  6. Select an Azure datacenter Location.
  7. For Source disk, select the Managed Disk to snapshot.
  8. Select the Account type to use to store the snapshot. We recommend Standard_LRS unless you need it stored on a high performing disk.
  9. Click Create.

Use PowerShell to take a snapshot

The following steps show you how to get the VHD disk to be copied, create the snapshot configurations, and take a snapshot of the disk by using the New-AzureRmSnapshot cmdlet.

Make sure that you have the latest version of the AzureRM.Compute PowerShell module installed. Run the following command to install it.

Install-Module AzureRM.Compute -RequiredVersion 2.6.0

For more information, see Azure PowerShell Versioning.

  1. Set some parameters.

    $resourceGroupName = 'myResourceGroup' 
    $location = 'eastus' 
    $dataDiskName = 'myDisk' 
    $snapshotName = 'mySnapshot'  
    
  2. Get the VHD disk to be copied.

    $disk = Get-AzureRmDisk -ResourceGroupName $resourceGroupName -DiskName $dataDiskName 
    
  3. Create the snapshot configurations.

    $snapshot =  New-AzureRmSnapshotConfig -SourceUri $disk.Id -CreateOption Copy -Location $location 
    
  4. Take the snapshot.

    New-AzureRmSnapshot -Snapshot $snapshot -SnapshotName $snapshotName -ResourceGroupName $resourceGroupName 
    

    If you plan to use the snapshot to create a Managed Disk and attach it a VM that needs to be high performing, use the parameter -AccountType Premium_LRS with the New-AzureRmSnapshot command. The parameter creates the snapshot so that it's stored as a Premium Managed Disk. Premium Managed Disks are more expensive than Standard. So be sure you really need Premium before using that parameter.

Next steps

Create a virtual machine from a snapshot by creating a managed disk from a snapshot and then attaching the new managed disk as the OS disk. For more information, see the Create a VM from a snapshot sample.