In the most recent Windows Azure PowerShell update we have introduced a new cmdlet called Save-AzureVhd to complement Add-AzureVhd.
Save-AzureVhd provides an optimized download experience where it uses the underlying Page blob APIs to only download written bytes. In other words if you have a 1TB VHD but only have a few GB of data written to it the cmdlet will only download the 2-3GB of data. The cmdlet writes the disks as fixed disks on the local disk so you will of course need the full disk size (1TB in this example) on the local storage location.
Here is a quick example to get you up and running:
# Select correct subscription - ensure CurrentStorageAccount is set! Select-AzureSubscription mysubscription # Source VHD Location $source = "http://mwstorage.blob.core.windows.net/disks/myosdisk.vhd" # Target VHD Location Save-AzureVhd -Source $source -LocalFilePath "d:LocalStoragemyosdisk.vhd"
I’m working on another code sample to download the disks of an entire VM for an offline backup. I’ll post it as soon as it is ready