Last active
September 20, 2016 15:56
-
-
Save sballarati/b761dab52de1508a2ab1 to your computer and use it in GitHub Desktop.
Copies an Azure blob to another account
This file contains 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
#change the current storage account | |
Set-AzureSubscription -SubscriptionName "{source subscription}" -CurrentStorageAccount "{storage account name}" | |
Select-AzureSubscription "{source subscription}" | |
$destContext = New-AzureStorageContext –StorageAccountName "{destination storage account}" -StorageAccountKey "" | |
$sourceContext = New-AzureStorageContext –StorageAccountName "{source account}" -StorageAccountKey "" | |
#New-AzureStorageContainer -Name "{container name}" | |
### Asynchronous Copy From Blob Context to Blob Context ### | |
$blob1 = Start-CopyAzureStorageBlob -SrcContext $sourceContext -SrcBlob "{blob name}" -SrcContainer "{container}" -DestContext $destContext -DestContainer "{container}" -DestBlob "{blob destination}" | |
#$blob2 = {you can copy the previous statement to copy more than one blob in paralell} | |
$blob1 | Get-AzureStorageBlobCopyState |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment