Copy blobs between Azure storage accounts with AzCopy v10 (2024)

  • Article

You can copy blobs, directories, and containers between storage accounts by using the AzCopy v10 command-line utility.

To see examples for other types of tasks such as uploading files, downloading blobs, and synchronizing with Blob storage, see the links presented in the Next Steps section of this article.

AzCopy uses server-to-server APIs, so data is copied directly between storage servers.

Get started

See the Get started with AzCopy article to download AzCopy and learn about the ways that you can provide authorization credentials to the storage service.

Note

The examples in this article assume that you've provided authorization credentials by using Microsoft Entra ID and that your Microsoft Entra identity has the proper role assignments for both source and destination accounts.

Alternatively you can append a SAS token to either the source or destination URL in each AzCopy command. For example: azcopy copy 'https://<source-storage-account-name>.blob.core.windows.net/<container-name>/<blob-path><SAS-token>' 'https://<destination-storage-account-name>.blob.core.windows.net/<container-name>/<blob-path><SAS-token>'.

Guidelines

Apply the following guidelines to your AzCopy commands.

  • If you're using Microsoft Entra authorization for both source and destination, then both accounts must belong to the same Microsoft Entra tenant.

  • Your client must have network access to both the source and destination storage accounts. To learn how to configure the network settings for each storage account, see Configure Azure Storage firewalls and virtual networks.

  • If you copy to a premium block blob storage account, omit the access tier of a blob from the copy operation by setting the s2s-preserve-access-tier to false (For example: --s2s-preserve-access-tier=false). Premium block blob storage accounts don't support access tiers.

  • You can increase the throughput of copy operations by setting the value of the AZCOPY_CONCURRENCY_VALUE environment variable. To learn more, see Increase Concurrency.

  • If the source blobs have index tags, and you want to retain those tags, you'll have to reapply them to the destination blobs. For information about how to set index tags, see the Copy blobs to another storage account with index tags section of this article.

Copy a blob

Copy a blob to another storage account by using the azcopy copy command.

Tip

This example encloses path arguments with single quotes (''). Use single quotes in all command shells except for the Windows Command Shell (cmd.exe). If you're using a Windows Command Shell (cmd.exe), enclose path arguments with double quotes ("") instead of single quotes ('').

Syntax

azcopy copy 'https://<source-storage-account-name>.<blob or dfs>.core.windows.net/<container-name>/<blob-path>' 'https://<destination-storage-account-name>.<blob or dfs>.core.windows.net/<container-name>/<blob-path>'

Example

azcopy copy 'https://mysourceaccount.blob.core.windows.net/mycontainer/myTextFile.txt' 'https://mydestinationaccount.blob.core.windows.net/mycontainer/myTextFile.txt'

Example (Data Lake Storage endpoints)

azcopy copy 'https://mysourceaccount.dfs.core.windows.net/mycontainer/myTextFile.txt' 'https://mydestinationaccount.dfs.core.windows.net/mycontainer/myTextFile.txt'

The copy operation is synchronous so when the command returns, that indicates that all files have been copied.

Copy a directory

Copy a directory to another storage account by using the azcopy copy command.

Tip

This example encloses path arguments with single quotes (''). Use single quotes in all command shells except for the Windows Command Shell (cmd.exe). If you're using a Windows Command Shell (cmd.exe), enclose path arguments with double quotes ("") instead of single quotes ('').

Syntax

azcopy copy 'https://<source-storage-account-name>.<blob or dfs>.core.windows.net/<container-name>/<directory-path>' 'https://<destination-storage-account-name>.<blob or dfs>.core.windows.net/<container-name>' --recursive

Example

azcopy copy 'https://mysourceaccount.blob.core.windows.net/mycontainer/myBlobDirectory' 'https://mydestinationaccount.blob.core.windows.net/mycontainer' --recursive

Example (Data Lake Storage endpoints)

azcopy copy 'https://mysourceaccount.dfs.core.windows.net/mycontainer/myBlobDirectory' 'https://mydestinationaccount.dfs.core.windows.net/mycontainer' --recursive

The copy operation is synchronous. All files have been copied when the command returns.

Copy a container

Copy a container to another storage account by using the azcopy copy command.

Tip

This example encloses path arguments with single quotes (''). Use single quotes in all command shells except for the Windows Command Shell (cmd.exe). If you're using a Windows Command Shell (cmd.exe), enclose path arguments with double quotes ("") instead of single quotes ('').

Syntax

azcopy copy 'https://<source-storage-account-name>.<blob or dfs>.core.windows.net/<container-name>' 'https://<destination-storage-account-name>.<blob or dfs>.core.windows.net/<container-name>' --recursive

Example

azcopy copy 'https://mysourceaccount.blob.core.windows.net/mycontainer' 'https://mydestinationaccount.blob.core.windows.net/mycontainer' --recursive

Example (Data Lake Storage endpoints)

azcopy copy 'https://mysourceaccount.dfs.core.windows.net/mycontainer' 'https://mydestinationaccount.dfs.core.windows.net/mycontainer' --recursive

The copy operation is synchronous. All files have been copied when the command returns.

Copy containers, directories, and blobs

Copy all containers, directories, and blobs to another storage account by using the azcopy copy command.

Tip

This example encloses path arguments with single quotes (''). Use single quotes in all command shells except for the Windows Command Shell (cmd.exe). If you're using a Windows Command Shell (cmd.exe), enclose path arguments with double quotes ("") instead of single quotes ('').

Syntax

azcopy copy 'https://<source-storage-account-name>.<blob or dfs>.core.windows.net/' 'https://<destination-storage-account-name>.<blob or dfs>.core.windows.net/' --recursive

Example

azcopy copy 'https://mysourceaccount.blob.core.windows.net/' 'https://mydestinationaccount.blob.core.windows.net' --recursive

Example (Data Lake Storage endpoints)

azcopy copy 'https://mysourceaccount.dfs.core.windows.net/' 'https://mydestinationaccount.dfs.core.windows.net' --recursive

The copy operation is synchronous so when the command returns, that indicates that all files have been copied.

Copy blobs to another storage account and add blob index tags to the target blob.

If you're using Microsoft Entra authorization, your security principal must be assigned the Storage Blob Data Owner role, or it must be given permission to the Microsoft.Storage/storageAccounts/blobServices/containers/blobs/tags/write Azure resource provider operation via a custom Azure role. If you're using a Shared Access Signature (SAS) token, that token must provide access to the blob's tags via the t SAS permission.

To add tags, use the --blob-tags option along with a URL encoded key-value pair.

For example, to add the key my tag and a value my tag value, you would add --blob-tags='my%20tag=my%20tag%20value' to the destination parameter.

Separate multiple index tags by using an ampersand (&). For example, if you want to add a key my second tag and a value my second tag value, the complete option string would be --blob-tags='my%20tag=my%20tag%20value&my%20second%20tag=my%20second%20tag%20value'.

The following examples show how to use the --blob-tags option.

Tip

These examples enclose path arguments with single quotes (''). Use single quotes in all command shells except for the Windows Command Shell (cmd.exe). If you're using a Windows Command Shell (cmd.exe), enclose path arguments with double quotes ("") instead of single quotes ('').

Blob example

azcopy copy 'https://mysourceaccount.blob.core.windows.net/mycontainer/myTextFile.txt' 'https://mydestinationaccount.blob.core.windows.net/mycontainer/myTextFile.txt' --blob-tags='my%20tag=my%20tag%20value&my%20second%20tag=my%20second%20tag%20value'

Directory example

azcopy copy 'https://mysourceaccount.blob.core.windows.net/mycontainer/myBlobDirectory' 'https://mydestinationaccount.blob.core.windows.net/mycontainer' --recursive --blob-tags='my%20tag=my%20tag%20value&my%20second%20tag=my%20second%20tag%20value'

Container example

azcopy copy 'https://mysourceaccount.blob.core.windows.net/mycontainer' 'https://mydestinationaccount.blob.core.windows.net/mycontainer' --recursive --blob-tags='my%20tag=my%20tag%20value&my%20second%20tag=my%20second%20tag%20value'

Account example

azcopy copy 'https://mysourceaccount.blob.core.windows.net/' 'https://mydestinationaccount.blob.core.windows.net' --recursive --blob-tags='my%20tag=my%20tag%20value&my%20second%20tag=my%20second%20tag%20value'

The copy operation is synchronous. All files have been copied when the command returns.

Note

If you specify a directory, container, or account for the source, all the blobs that are copied to the destination will have the same tags that you specify in the command.

Copy with optional flags

You can tweak your copy operation by using optional flags. Here's a few examples.

ScenarioFlag
Copy blobs as Block, Page, or Append Blobs.--blob-type=[BlockBlob|PageBlob|AppendBlob]
Copy to a specific access tier (such as the archive tier).--block-blob-tier=[None|Hot|Cool|Archive]
Automatically decompress files.--decompress=[gzip|deflate]

For a complete list, see options.

Next steps

Find more examples in these articles:

  • Examples: Upload
  • Examples: Download
  • Examples: Synchronize
  • Examples: Amazon S3 buckets
  • Examples: Google Cloud Storage
  • Examples: Azure Files
  • Tutorial: Migrate on-premises data to cloud storage by using AzCopy

See these articles to configure settings, optimize performance, and troubleshoot issues:

  • AzCopy configuration settings
  • Optimize the performance of AzCopy
  • Find errors and resume jobs by using log and plan files in AzCopy
  • Troubleshoot problems with AzCopy v10
  • Use AzCopy to copy blobs between Azure storage accounts with network restrictions
Copy blobs between Azure storage accounts with AzCopy v10 (2024)
Top Articles
Rare 50 cent coin worth $200: 'Most valuable'
Transfer Existing EPS Account to New Employer - Step-by-Step Guide
Bleak Faith: Forsaken – im Test (PS5)
Jennifer Hart Facebook
Breaded Mushrooms
Mopaga Game
Guardians Of The Galaxy Showtimes Near Athol Cinemas 8
Botanist Workbench Rs3
EY – все про компанію - Happy Monday
Gunshots, panic and then fury - BBC correspondent's account of Trump shooting
Noaa Swell Forecast
How to Type German letters ä, ö, ü and the ß on your Keyboard
Tanger Outlets Sevierville Directory Map
Evita Role Wsj Crossword Clue
Canelo Vs Ryder Directv
My.doculivery.com/Crowncork
Was sind ACH-Routingnummern? | Stripe
Our Facility
zopiclon | Apotheek.nl
Persona 4 Golden Taotie Fusion Calculator
2024 Non-Homestead Millage - Clarkston Community Schools
Rhinotimes
Baywatch 2017 123Movies
Haunted Mansion Showtimes Near Millstone 14
Bj Alex Mangabuddy
Craighead County Sheriff's Department
Aldine Isd Pay Scale 23-24
Army Oubs
Royal Cuts Kentlands
Forest Biome
Culver's Flavor Of The Day Taylor Dr
Bella Bodhi [Model] - Bio, Height, Body Stats, Family, Career and Net Worth 
Noaa Duluth Mn
Xsensual Portland
Wics News Springfield Il
Victory for Belron® company Carglass® Germany and ATU as European Court of Justice defends a fair and level playing field in the automotive aftermarket
Mdt Bus Tracker 27
27 Modern Dining Room Ideas You'll Want to Try ASAP
Superhot Free Online Game Unblocked
101 Lewman Way Jeffersonville In
Ryujinx Firmware 15
Rust Belt Revival Auctions
Staar English 1 April 2022 Answer Key
Sams La Habra Gas Price
Todd Gutner Salary
Poe Self Chill
Canonnier Beachcomber Golf Resort & Spa (Pointe aux Canonniers): Alle Infos zum Hotel
Ewwwww Gif
SF bay area cars & trucks "chevrolet 50" - craigslist
Zalog Forum
How To Find Reliable Health Information Online
Latest Posts
Article information

Author: Fr. Dewey Fisher

Last Updated:

Views: 6284

Rating: 4.1 / 5 (42 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Fr. Dewey Fisher

Birthday: 1993-03-26

Address: 917 Hyun Views, Rogahnmouth, KY 91013-8827

Phone: +5938540192553

Job: Administration Developer

Hobby: Embroidery, Horseback riding, Juggling, Urban exploration, Skiing, Cycling, Handball

Introduction: My name is Fr. Dewey Fisher, I am a powerful, open, faithful, combative, spotless, faithful, fair person who loves writing and wants to share my knowledge and understanding with you.