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-
1 2 3 4 5 6 7 8 9 |
az storage blob copy start \ --source-account-name somevhds \ --source-account-key TheLongKeyYouCopiedFromAccessKeys \ --source-container vhdblob \ --source-blob vhdname.vhd \ --account-name mystorage \ --account-key TheOtherLongKeyYouCopiedFromAccessKeys \ --destination-container vms --destination-blob vhdname.vhd |
The copy process took just a few seconds (couldnt beleive it myself 🙂 Happy copying / Roman