Download a Linux VHD from Azure
Applies to: ✔️ Linux VMs ✔️ Flexible scale sets
In this article, you learn how to download a Linux virtual hard disk (VHD) file from Azure using the Azure portal.
Stop the VM
A VHD can’t be downloaded from Azure if it's attached to a running VM. If you want to keep the VM running, you can create a snapshot and then download the snapshot.
To stop the VM:
Sign in to the Azure portal.
On the left menu, select Virtual Machines.
Select the VM from the list.
On the page for the VM, select Stop.
Alternative: Snapshot the VM disk
Take a snapshot of the disk to download.
- Select the VM in the portal.
- Select Disks in the left menu and then select the disk you want to snapshot. The details of the disk will be displayed.
- Select Create Snapshot from the menu at the top of the page. The Create snapshot page will open.
- In Name, type a name for the snapshot.
- For Snapshot type, select Full or Incremental.
- When you are done, select Review + create.
Your snapshot will be created shortly, and can then be used to download or create another VM.
If you don't stop the VM first, the snapshot will not be clean. The snapshot will be in the same state as if the VM had been power cycled or crashed at the point in time when the snapshot was made. While usually safe, it could cause problems if the running applications running at the time were not crash resistant.
This method is only recommended for VMs with a single OS disk. VMs with one or more data disks should be stopped before download or before creating a snapshot for the OS disk and each data disk.
Generate SAS URL
To download the VHD file, you need to generate a shared access signature (SAS) URL. When the URL is generated, an expiration time is assigned to the URL.
- On the menu of the page for the VM, select Disks.
- Select the operating system disk for the VM, and then select Disk Export.
- If the needed, update the value of URL expires in (seconds) to give you enough time to complete the download. The default is 3600 seconds (one hour).
- Select Generate URL.
Under the URL that was generated, select Download the VHD file.
You may need to select Save in the browser to start the download. The default name for the VHD file is abcd.