I have a VM on Azure, it has many websites and databases with configurations which make it a little tricky to export everything from there.
Now I don't want any of these website to be running and for sure don't want to keep paying for an unused VM on Azure, I stopped the machine, but I am still getting billed because of the storage of the VM disks.
So my question:
How to download the whole VM so that I can back up somewhere else locally and be able to open it on my local machine latter if I needed to copy some files from there?
I have found some articles but because Azure is growing and changing too fast, I found them out dated and couldn't help me what I wanted to achieve.
Any advice or references are much appreciated.
It depends whether you are using Managed Disks or VHD based disks for your VM. If you are using Managed Disks (which is the default and best option to use) then you cannot download this directly, you would need to first export it to a VHD file in a storage account, and then download this VHD file. Managed disks can be exported using the portal (there is an "export" button when you click on the disk) or using PowerShell.
If your using VHD storage, or you have copied your managed disk to a VHD, then it is just a case of using tools like Azure Storage Explorer to connect to the storage account and download it.
Fairly detailed instructions are available at the Azure docs site. Note that this applies to VMs running Windows.
Basically, in the Disk > Export menu in the Azure portal you can generate a "shared access signature", which will give you a download URL together with an expiration time (1 hour by default; you are well advised to increase this).
Update: Depending on your bandwidth you may experience timeouts or the whole download may fail. However: Microsoft provides a free application called "Azure Storage Explorer" which can be used to download VM disks at a much higher speed than what you can get with a Web browser. For instance, the HTTPS download link method gave me an average download speed of about 2.3 MB/s and quite often it failed. With the Storage Explorer my download speed is around 20 MB/s . YMMV of course.