Skip to content

Azure blob list copy from one azure blob container to another blob container using simple and easy PowerShell Script

Notifications You must be signed in to change notification settings

eathanspark/azureblobcopy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PowerShell: Copy List of Blobs from One Azure Blob Container to Another in Batches

Use Case / Requirment

We have a web portal which stores files in a azure blob conatiner by uploading from UI in different folder sturcture based on category, location, market ..etc inside same container. Now we have to copy some specific files from this container to another container with same folder struture.

Solution Features

  • Find out the files which need to be copy to another conatine byt using this script File Name List and create source csv file as given in sample file.
  • Filter (exclude files having extention like .doc/.docx/.ppt/.pptx/.pdf/.txt etc)
  • Batch Execution by setting up batch size in script
  • Exception Handling
  • Logging
  • Copy status as output file

Prerequisite

  • Azure Storage Account Name
  • Azure Storage Account Key
  • Azure Blob Container Name

Library Used

  • Powershell Az Module
  • New-AzStorageContext
  • Get-AzStorageBlob
  • Copy-AzStorageBlob
  • Export-Csv

Script

FileTransfer.ps1

Source CSV File

sourceFile.csv

Output CSV File

outputFile.csv