-CreateOption Attach -DiskSizeInGB 1023 -VhdUri $dataDiskVhdURI
To retrieve a VHD from Microsoft Azure, the process is similar. Download the VHD
and then create a virtual machine locally that uses it. To download the VHD, perform
the following:
$sourceVHD = "https://storact10.blob.core.windows.net/vhds/test1.vhd" $destinationVHD = "D:\temp\test1.vhd" Save-AzureRmVhd -Source $sourceVHD
-LocalFilePath $destinationVHD -NumberOfThreads 5
Hopefully, this showed that it’s fairly simple to move VHDs into and out of Microsoft
Azure. PowerShell is just one option, but you can use it in pretty much any other
environment, including automated processes to bulk-move virtual machines. This was
performing a manual migration of VMs. The other, preferred approach would be using
Azure Site Recovery, which would replicate the storage and create the VM in Azure
with a minimum amount of downtime.