Created
August 17, 2014 19:46
-
-
Save stlk/24827871eb13d5778fee to your computer and use it in GitHub Desktop.
copy file from one azure container to another
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
$srcUri = "http://something.blob.core.windows.net/vhds/something.vhd" | |
### Source Storage Account ### | |
$srcStorageAccount = "NAME" | |
$srcStorageKey = "KEY" | |
### Target Storage Account ### | |
$destStorageAccount = "NAME" | |
$destStorageKey = "KEY" | |
### Target Container Name | |
$containerName = "vhds" | |
### 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 | |
### 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 "something.vhd" ` | |
-DestContext $destContext |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment