In Azure copying objects from one subscription to
another subscription OR within same subscription is very easy without any complexity.
In this copy you don’t need to provide subscription ID or address etc.
To access storage accounts in Azure a key is
required. Key you can get from Azure portal (As shown below in properties of Azure Storage 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
#======================================= | |
#Put Your Source Storage Account Name | |
#======================================= | |
$MySourceStorageAccountName = "" | |
#======================================= | |
#Put Your Storage Key of Source Account | |
#======================================= | |
$MySourceStorageAccountKey = "" | |
$MySourceContainerName = "" | |
$MySourceContext = New-AzureStorageContext -StorageAccountName $MySourceStorageAccountName -StorageAccountKey $MySourceStorageAccountKey | |
#======================================= | |
#Put Your Destination Storage Account | |
#======================================= | |
$MyDestinationStorageAccount = "" | |
#======================================= | |
#Put Your Storage Key of Destination Account | |
#======================================= | |
$DestStorageAccountKey = "" | |
#======================================= | |
#Put Your Destination Container Name | |
#======================================= | |
$MyDestinationContainerName = "" | |
$MyDestinationContext = New-AzureStorageContext -StorageAccountName $MyDestinationStorageAccount -StorageAccountKey $DestStorageAccountKey | |
#======================================= | |
#Get a reference to blobs in the source container. | |
#======================================= | |
$blobs = Get-AzureStorageBlob -Container $MySourceContainerName -Context $MySourceContext | |
#======================================= | |
# Copy blob(Data) Source to Destination container | |
#======================================= | |
$blobs| Start-AzureStorageBlobCopy -DestContainer $MyDestinationContainerName -DestContext $MyDestinationContext |