Copy an Azure VHD blob between different subscriptions/tenants

Hi all !

I recently came across the problem to have 2 subscriptions in 2 different tenants and needed to copy a VHD blob from one to the other. The file is around 30GB large so downloading/uploading over my ADSL wasnt an option.

The az cli gave me a fast and easy way to make this happen.

Preperation

What you need to aquire before running the command is:

  • source-account-name ( the storage account name of the source subscription)
  • source-account-key (one of the access Keys (key1 or key2) of the source storage account)
  • source-container (blobs are organized in containers. you need the container name where the source blob is located)
  • sourece-blob (the name of the blob – in my case the vhd i wanted to copy)
  • account-name (the target account name in the target subscription wher the new blob shall be copied)
  • account-key (the access key – same as for source – for the target storage account)
  • destination-container (the name of the blob container where the blob shall be copied)
  • destination-blob (the name of the blob – proably the same as the source blob name)

Finally, just use the example below (without the „\“, they are just for easy reading) with your values-

The copy process took just a few seconds (couldnt beleive it myself 🙂 Happy copying / Roman