Azure copying VMs or blobs between subscriptions

Update: There is a new version of Azcopy 2.5 now available, see here:

If you have more than 1 Azure subscription, you may have need to move or copy items between them.  The excellent Azcopy application available here: can be your friend.  See this article for more details on Azcopy:

Here's an example of how to copy an entire Azure container (in this case a container of VHDs) and it's contents between subs: 

$env:path += ";${env:ProgramFiles(x86)}microsoft sdkswindows azureazcopy"

$sourceContainer = ''
$destinationContainer = ''
$sourcekey = 'your-source-container-key'
$destkey = 'your-destination-container-key'
$logPath = 'c:dumpcopyblob.log'
Azcopy $sourceContainer $destinationContainer /SourceKey:$sourcekey /DestKey:$destkey /S /Z:$logPath

Don't forget the /S parameter as this is used for a recursive copy from the ~/vhd container down in the above example.  If you want to move files rather than copy them you can use the /MOV switch.


Comments (0)

Skip to main content