I created an Azure VM some time back and need to copy it to another account as the new account has a subscription with more credit. I am trying to copy the vm however cannot find the vhd uri. I wanted to use AzCopy. When I click on disks from the Settings menu I see a resource ID which is not a url. Am I missing something here?
Asked
Active
Viewed 6,322 times
0
-
it seems your vm create by managed disk, if you want to Azcopy it to other account, we should copy it to storage account then copy to another Azure account. – Jason Ye Aug 09 '17 at 22:25
-
Yea the VM was created by Managed disks. However I do not find the vhd in any storage accounts. I checked through Azure Storage explorer. I am baffled. It should nt be so hard to find the vhd. I also created a new VM but did not find VHD for the same too. What am I missing? – user1552466 Aug 10 '17 at 14:20
-
We can use powershell to copy vhd from managed disk to another unmanaged disk direct, please check my answer:) – Jason Ye Aug 11 '17 at 06:26
2 Answers
3
Now how do I move this snapshot to a different azure account to create a VM of this snapshot.
We can't copy or move snapshot to different Azure account direct. If you want to move this snapshot, we should use this snapshot to create a managed disk and copy this managed disk to another storage account.
So we can use PowerShell to copy VHD from managed disk to unmanaged disk, then use this new VHD to create a new VM.
We can do that with PowerShell command:
$sas = Grant-AzureRmDiskAccess -ResourceGroupName "[ResourceGroupName]" -DiskName "[ManagedDiskName]" -DurationInSecond 3600 -Access Read
$destContext = New-AzureStorageContext –StorageAccountName "[StorageAccountName]" -StorageAccountKey "[StorageAccountAccessKey]"
$blobcopy=Start-AzureStorageBlobCopy -AbsoluteUri $sas.AccessSAS -DestContainer "[ContainerName]" -DestContext $destContext -DestBlob "[NameOfVhdFileToBeCreated].vhd"
After copy completed, we can use the new VHD to create a VM.
Here a similar case, please refer to the answer.

Jason Ye
- 13,710
- 2
- 16
- 25
-
Just want to confirm the current situations.Please feel free to let me know if you need further assistance. – Jason Ye Aug 14 '17 at 00:36
-
1

Zhaoxing Lu
- 6,319
- 18
- 41
-
Probably Jason Ye is correct - perhaps your VM was created by managed disk. Please follow his suggestions if it's the case. :) – Zhaoxing Lu Aug 09 '17 at 22:30
-
Yea the VM was created by Managed disks. However I do not find the vhd in any storage accounts. I checked through Azure Storage explorer. I am baffled. It should nt be so hard to find the vhd. I also created a new VM but did not find VHD for the same too. What am I missing? – user1552466 Aug 10 '17 at 14:21
-
Ok further I found with managed disks you cannot find the vhd. but need to create snapshot. I did so. Now how do I move this snapshot to a different azure account to create a VM of this snapshot. – user1552466 Aug 10 '17 at 18:29
-
@user1552466 Good to hear that you've resolved the problem by yourself. :) – Zhaoxing Lu Aug 11 '17 at 01:03