1,first we need to create a source storage account for migration.
rgName=”roger02”location =”East Asia”
storageAccountName=”roger1026”New−AzureRmResourceGroup−NamergName -Location locationNew−AzureRmStorageAccount−NamestorageAccountName -Location location−SkuNamePremiumLRS−ResourceGroupNamergName
2,create a new storage account in the region we want to move to.
rgName=”roger01”location =”West Europe”
storageAccountName=”roger109”New−AzureRmResourceGroup−NamergName -Location locationNew−AzureRmStorageAccount−NamestorageAccountName -Location location−SkuNamePremiumLRS−ResourceGroupNamergName
3,create a managed disk under the resource group “roger02” within portal




4,execute the rest commands to copy the blob and get a status.
Source storage account
rgName=”roger02”location =”East Asia”
storageAccountName=”roger1026”diskName =”rogerdisk”
Target storage account
destrgName=”roger01”destlocation =”West Europe”
deststorageAccountName=”roger109”destdiskName =”destrogerdisk”
Assign access to the source disk
sas=Grant−AzureRmDiskAccess−ResourceGroupNamergName -DiskName $diskName -DurationInSecond 3600 -Access Read
saKey=Get−AzureRmStorageAccountKey−ResourceGroupNamedestrgName -Name deststorageAccountNamestorageContext =New-AzureStorageContext –StorageAccountName deststorageAccountName−StorageAccountKeysaKey[0].Value
New-AzureStorageContainer -Context $storageContext -Name vhds10261
Start-AzureStorageBlobCopy -AbsoluteUri sas.AccessSAS−DestContainervhds10261−DestContextstorageContext -DestBlob $destdiskName
Get-AzureStorageBlobCopyState -Context storageContext−BlobdestdiskName -Container vhds10261
Now we only need to wait for the replication process to complete. The above is the steps to migrate the managed disk through the powershell command.
Note:
If the managed disk is attached to the VM, stop the VM and copy it to the storage account.