Copy blobs from one storage container to another storage Container in Microsoft Azure

In my previous post, we discussed how to create a storage container and upload video files to it.

We had a further requirement to move the files from one container to another container.

As I have mentioned in my earlier blogs we can achieve by console application and PowerShell script.

I will be providing the PowerShell script for the same.

We will have to define source and destination storage account details to copy the blobs.

Please find the code below. Hope it will be helpful.

$srcAcc = “samstorage”

$srcAccKey = “*************************** ==”

$srccontName = “srcvideocontainer”

$srcctx = New-AzureStorageContext -StorageAccountName $srcAcc -StorageAccountKey $srcAccKey

$destAcc = “deststorage”

$destAccKey = “*************************** ==”

$destcontName = “destcontainername”

$destctx = New-AzureStorageContext -StorageAccountName $destcontName -StorageAccountKey $destAccKey

#source container reference

$blobs = Get-AzureStorageBlob -Container $srccontName -Context $srcctx

#Copy blobs

$blobs| Start-AzureStorageBlobCopy -DestContainer $destcontName -DestContext $destctx

Read some SharePoint tutorials below:


Hope this will be helpful.

Check out Best Alternative to InfoPath -> Try Now

You May Also like the Following SharePoint Online Tutorials:

About Sambita Rath

I have 9 years of exprience into SharePoint implementation, architecture, Administrator, development and Training.Designing Information Architecture in SharePoint 2007, 2010,2013 and Office 365.

View all posts by Sambita Rath →