For performance reasons it is best practice to use a different Storage Account for each VHD you create. Sometimes it’s even better to use multiple storage accounts and stripe the files into one disk, but the is another thing. I just created the VHD in an existing Storage Account and want to move it.
Install Windows Azure PowerShell by running the Microsoft Web Platform Installer. After installation start the Windows Azure PowerShell and run the “Add-AzureAccount” command. This will configure your environment to access your Windows Azure subscription.
Head over to Michael Washam’s post and copy the “Initiating an Asynchronous Copy Request (authenticated source)” script. Change it to use your subscription, accounts, keys and filenames. Copy of his script below.
Select-AzureSubscription "my subscription" ### Source VHD (West US) - authenticated container ### $srcUri = "http://mwwestus1.blob.core.windows.net/sourceauth/testcopy1.vhd" ### Source Storage Account (West US) ### $srcStorageAccount = "mwwestus1" $srcStorageKey = "SOURCESTORAGEKEY" ### Target Storage Account (West US) ### $destStorageAccount = "mwwestus2" $destStorageKey = "DESTSTORAGEKEY" ### Create the source storage account context ### $srcContext = New-AzureStorageContext -StorageAccountName $srcStorageAccount ` -StorageAccountKey $srcStorageKey ### Create the destination storage account context ### $destContext = New-AzureStorageContext -StorageAccountName $destStorageAccount ` -StorageAccountKey $destStorageKey ### Destination Container Name ### $containerName = "copiedvhds" ### Create the container on the destination ### New-AzureStorageContainer -Name $containerName -Context $destContext ### Start the asynchronous copy - specify the source authentication with -SrcContext ### $blob1 = Start-AzureStorageBlobCopy -srcUri $srcUri ` -SrcContext $srcContext ` -DestContainer $containerName ` -DestBlob "testcopy1.vhd" ` -DestContext $destContext ### Retrieve the current status of the copy operation ### $status = $blob1 | Get-AzureStorageBlobCopyState ### Print out status ### $status ### Loop until complete ### While($status.Status -eq "Pending"){ $status = $blob1 | Get-AzureStorageBlobCopyState Start-Sleep 10 ### Print out status ### $status }
Make sure you can run scripts. To check this run the “get-executionpolicy -list” command. Mine returned “Undefined” for all. I changed it with “set-executionpolicy remotesigned -scope currentuser” to allow the execution of the script.
Using the asynchronous method speeds up the copy over tooling like azure-explorer that seems to download and upload the data.