Copying Azure Blob Storage Containers Between Accounts With PowerShell and AzCopy
A few months ago I wrote about backing up and restoring Azure blobs from a local environment. You can read that post here . This is not an efficient approach for moving blobs from one Azure storage account to another. In this post I will show you how to copy all containers from one account to another using PowerShell and how to copy individual Azure storage containers using AzCopy. Copying All Containers with PowerShell This script will copy all containers from one Azure storage account to another. This can be useful for populating Azure development accounts. First we will set up our Azure storage accounts and create a storage context for each: $SourceAzureAccountName = "SourceAzureAccount" $SourceAzureKey = "SourceAzureKey" $DestAzureAccountName = "DestAzureAccount" $DestAzureKey = "DestAzureKey" $SourceCtx = New-AzureStorageContext $SourceAzureAccountName -StorageAccountKey $SourceAzureKey $DestCtx = New-AzureStorageContext $DestAzur...