How do I copy files using AzCopy? | How to copy files from one container to another in Azure storage using AzCopy?

This Article describe,

How do I copy files using AzCopy? or how to copy files from one container to another in Azure storage using AzCopy?

AzCopy is a command-line utility designed for copying data to/from Microsoft Azure Blob, File, and Table storage, using simple commands designed for optimal performance. It can be used to transfer data within a storage account, between storage accounts, or between an on-premises file system and a storage account.

AzCopy can also be used to upload files to Azure storage, synchronize directories, and perform other data transfer tasks.

From SQL Server 2012 on words, we can take URL backup on Azure blob storage. We can use azcopy azure between storage accounts.

Sometime we need to download or upload SQL Server backup file on Azure blob storage This can be done either using Azure storage explorer or we can use AZ copy to download or upload files.

AZcopy azure is tool used to copy file from disk drive to blob storage or vice versa. In earlier version of AZ copy we need to do few configurations but from Az copy V10 process got very simple, and we just need to download zip file of Az Copy and start using it. azcopy upload file to blob.

Steps for How do I copy files using AzCopy?

  1. Azcopy download (Current version: 10.15.0) file downloaded from below link: Az Copy Download Link
  2. After downloading’s extract zip file to any location.

E.g.: C:\Backup\azcopy_windows_amd64_10.10.0\azcopy.exe

3. Az copy V10 only support Shared access signature URL. We need to create shared access signature for blob where we want to upload or download file. Copy Shared access signature and replace % with %% if we are using windows batch file. Keep it same if running with powershell(ps1) file.

Shared signature URL will look like below:

https://test.blob.core.windows.net/test?sv=2020-10-02&st=2022-01-14T11%%3A29%%3A36Z&se=2024-01-15T11%%3A29%%3A00Z&sr=c&sp=racwl&sig=pVdarMU0%%2BAGxejLmXoyhdK28YI6XjjOGESj4V31ENHU%%3D

3. We can Copy or move data to Azure Storage by using AzCopy v10.

Below are few azcopy copy command example

azcopy azure examples,

azcopy download file:

C:\azcopy_windows_amd64_10.13.0\azcopy_windows_amd64_10.13.0\AzCopy.exe" copy "https://singpostdiag.blob.core.windows.net/downloadfile?sv=2020-10-02&st=2022-01-14T11%%3A29%%3A36Z&se=2024-01-15T11%%3A29%%3A00Z&sr=c&sp=racwl&sig=pVdarMU0%%2BAGxejLmXoyhdK28YI6XjjOGESj4V31ENHU%%3D" "H:\backup"\

If we want to copy specific file or specific date, there are parameters which can be used.

Upload files to Azure Blob storage by using AzCopy v10:

C:\azcopy_windows_amd64_10.13.0\azcopy_windows_amd64_10.13.0\AzCopy.exe" copy  "H:\backup" "https://singpostdiag.blob.core.windows.net/downloadfile?sv=2020-10-02&st=2022-01-14T11%%3A29%%3A36Z&se=2024-01-15T11%%3A29%%3A00Z&sr=c&sp=racwl&sig=pVdarMU0%%2BAGxejLmXoyhdK28YI6XjjOGESj4V31ENHU%%3D"

E.g.

–include-pattern “NewDBTest_StackOverflow*”

–include-after “%datetimef%” –recursive

If you want to learn more click here

Create SQL Server Jobs using PowerShell | Automate SQL Server jobs Creation Using PowerShell

2 thoughts on “How do I copy files using AzCopy? | How to copy files from one container to another in Azure storage using AzCopy?”

  1. Thanks for the great info, and I would like to add that Azcopy is excellent for migrating to Azure blob and AWS S3, and also it is quick but not simple, On the other hand, we can use Shaegate or Gs Richcopy 360 for this task, both are simple, quick and have options to throttle the transfer speed

    Reply

Leave a Comment