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. You can copy data between a file system and a storage account, or between storage accounts.

Download all blobs in a container

AzCopy /Source: /Dest:C:\myfolder /SourceKey:key /S  

Download a file

azcopy copy "" "C:\myDirectory\myTextFile.txt"

Download a directory

azcopy copy " "C:\myDirectory" --recursive
azcopy copy "*" "C:\myDirectory"

Upload a file

azcopy copy "C:\myDirectory\myTextFile.txt" ""

Upload a directory

Append the --recursiveĀ flag to upload files in all sub-directories.

azcopy copy "C:\myDirectory" "" --recursive
azcopy copy "C:\myDirectory" "" --recursive
azcopy copy "C:\myDirectory\*" ""

Copy blobs between storage accounts

You can use AzCopy to copy blobs to other storage accounts. The copy operation is synchronous so when the command returns, that indicates that all files have been copied.

AzCopy uses server-to-server APIs, so data is copied directly between storage servers. These copy operations don’t use the network bandwidth of your computer. You can increase the throughput of these operations by setting the value of the AZCOPY_CONCURRENCY_VALUE environment variable. To learn more, see Optimize throughput.

Copy a containers to another storage account

azcopy copy "https://<source-storage-account-name><container-name>?<SAS-token>" "https://<destination-storage-account-name><container-name>" --recursive

Copy all containers, directories, and blobs to another storage account

azcopy copy "https://<source-storage-account-name><SAS-token>" "https://<destination-storage-account-name>" --recursive"

Synchronize files

You can synchronize the contents of a local file system with a blob container. Synchronization is one-way. In other words, you choose which of these two endpoints is the source and which one is the destination.

azcopy sync "https://<storage-account-name>.<blob or dfs><container-name>" "C:\myDirectory" --recursive


Last modified: August 21, 2019



Write a Reply or Comment