Jump to content













Photo
- - - - -

Copy AZURE VHD to other storage account

Posted by Pantelis Apostolidis , in Azure 19 December 2014 · 535 views

azure powershell

Copy AZURE VHD to other storage account

 

#Source storage account
$context1 = new-azurestoragecontext -storageaccountname "name_source_account" -storageaccountkey "key_source_account"

 

#Destination storage account
$context2 = new-azurestoragecontext -storageaccountname "name_destination_account" -storageaccountkey "key_destination_account"

 

#Initiate copy this might take a while
Start-AzureStorageBlobCopy -SrcContainer "vhds" -SrcBlob "name_as_found_in_step_one.vhd" -SrcContext $context1 -DestContainer "vhds" -DestBlob "my_destination_name.vhd" -DestContext $context2

 

Track Azure VHD copy process

 

$context = new-azurestoragecontext -storageaccountname "name_destination_account" -storageaccountkey "key_destination_account"

 

Get-AzureStorageBlobCopyState -Blob "file_name.vhd" -Container "vhds" -Context $context

 

source: http://www.e-apostolidis.gr/microsoft/copy-azure-vhd-to-other-storage-account/