Created
March 28, 2014 20:55
-
-
Save sdurandeu/9842815 to your computer and use it in GitHub Desktop.
Async Blob Copy - Windows Azure
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## For reference see http://michaelwasham.com/windows-azure-powershell-reference-guide/copying-vhds-blobs-between-storage-accounts/ | |
Import-Module Azure | |
Set-AzureSubscription -SubscriptionName "Azure SDK Testing" -CurrentStorageAccount "portalvhdsq1x0n4q4zbfq5" | |
Select-AzureSubscription "Azure Store SDK Testing" | |
$destContext = New-AzureStorageContext –StorageAccountName "{destAccountName}" ` | |
-StorageAccountKey "{destAccountKey}" | |
$sourceContext = New-AzureStorageContext –StorageAccountName "{sourceAccountName}" ` | |
-StorageAccountKey "{sourceAccountKey}" | |
#New-AzureStorageContainer -Name "teamcityvm" | |
### Asynchronous Copy From Blob Context to Blob Context ### | |
$blob1 = Start-CopyAzureStorageBlob -SrcContext $sourceContext -SrcBlob "gtnqfg43.ugz201402182142260377.vhd" -SrcContainer "vhds" ` | |
-DestContext $destContext -DestContainer "teamcityvm" -DestBlob "teamcity81-sysprep-image.vhd" | |
### Asynchronous Copy From URL to Blob Context ### | |
Set-AzureSubscription -SubscriptionName "WACOM DevTest" -CurrentStorageAccount "teamcity81vm" | |
$blob1 = Start-AzureStorageBlobCopy -srcUri "http://azurestorebackups.blob.core.windows.net/teamcityvm/teamcity81-sysprep-image.vhd" ` | |
-DestContainer "vhds" ` | |
-DestBlob "teamcity81-sysprep-image.vhd" ` | |
-DestContext $destContext | |
## Get State | |
$blob1 | Get-AzureStorageBlobCopyState |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment