Proposed Pull Request Change

title description author ms.service ms.topic ms.date ms.author ms.subservice ms.reviewer
Copy blobs between Azure storage accounts with AzCopy v10 This article contains a collection of AzCopy example commands that help you copy blobs between storage accounts. normesta azure-storage how-to 10/28/2025 normesta storage-common-concepts dineshm
📄 Document Links
GitHub View on GitHub Microsoft Learn View on Microsoft Learn
Raw New Markdown
Generating updated version of doc...
Rendered New Markdown
Generating updated version of doc...
+0 -0
+0 -0
--- title: Copy blobs between Azure storage accounts with AzCopy v10 description: This article contains a collection of AzCopy example commands that help you copy blobs between storage accounts. author: normesta ms.service: azure-storage ms.topic: how-to ms.date: 10/28/2025 ms.author: normesta ms.subservice: storage-common-concepts ms.reviewer: dineshm # Customer intent: As a cloud administrator, I want to use AzCopy to efficiently copy blobs, directories, and containers between Azure storage accounts, so that I can manage data transfers seamlessly and ensure data availability in different environments. --- # Copy blobs between Azure storage accounts by using AzCopy You can use the AzCopy v10 command-line utility to copy blobs, directories, and containers between storage accounts. For examples of other types of tasks, such as uploading files, downloading blobs, and synchronizing with Blob storage, see the links in the [Next Steps](#next-steps) section of this article. AzCopy uses [server-to-server](/rest/api/storageservices/put-block-from-url) [APIs](/rest/api/storageservices/put-page-from-url), so data is copied directly between storage servers. ## Get started See the [Get started with AzCopy](storage-use-azcopy-v10.md) 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 provide 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 use Microsoft Entra authorization for both source and destination, 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](storage-network-security.md?toc=/azure/storage/blobs/toc.json). To learn about supported network topologies when copying between accounts, see [Copy blobs between storage accounts with access restriction](/troubleshoot/azure/azure-storage/blobs/connectivity/copy-blobs-between-storage-accounts-network-restriction#copy-blobs-between-storage-accounts-with-access-restriction). - 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](storage-use-azcopy-optimize.md#increase-concurrency). - If the source blobs have index tags, and you want to retain those tags, you need 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](#copy-between-accounts-and-add-index-tags) section of this article. ## Copy a blob Copy a blob to another storage account by using the [azcopy copy](https://github.com/Azure/azure-storage-azcopy/wiki/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 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 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. When the command returns, it indicates that all files are copied. ## Copy a directory Copy a directory to another storage account by using the [azcopy copy](https://github.com/Azure/azure-storage-azcopy/wiki/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 azcopy copy 'https://mysourceaccount.blob.core.windows.net/mycontainer/myBlobDirectory' 'https://mydestinationaccount.blob.core.windows.net/mycontainer' --recursive ``` **Example (Data Lake Storage endpoints)** ```azcopy azcopy copy 'https://mysourceaccount.dfs.core.windows.net/mycontainer/myBlobDirectory' 'https://mydestinationaccount.dfs.core.windows.net/mycontainer' --recursive ``` The copy operation is synchronous. When the command returns, all files are copied. ## Copy a container Copy a container to another storage account by using the [azcopy copy](https://github.com/Azure/azure-storage-azcopy/wiki/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 azcopy copy 'https://mysourceaccount.blob.core.windows.net/mycontainer' 'https://mydestinationaccount.blob.core.windows.net/mycontainer' --recursive ``` **Example (Data Lake Storage endpoints)** ```azcopy azcopy copy 'https://mysourceaccount.dfs.core.windows.net/mycontainer' 'https://mydestinationaccount.dfs.core.windows.net/mycontainer' --recursive ``` The copy operation is synchronous. When the command returns, all files are copied. ## Copy containers, directories, and blobs Copy all containers, directories, and blobs to another storage account by using the [azcopy copy](https://github.com/Azure/azure-storage-azcopy/wiki/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 azcopy copy 'https://mysourceaccount.blob.core.windows.net/' 'https://mydestinationaccount.blob.core.windows.net' --recursive ``` **Example (Data Lake Storage endpoints)** ```azcopy azcopy copy 'https://mysourceaccount.dfs.core.windows.net/' 'https://mydestinationaccount.dfs.core.windows.net' --recursive ``` The copy operation is synchronous. When the command returns, it indicates that all files are copied. <a id="copy-between-accounts-and-add-index-tags"></a> ## Copy blobs and add index tags Copy blobs to another storage account and add [blob index tags](../blobs/storage-manage-find-blobs.md) to the target blob. If you're using Microsoft Entra authorization, assign the [Storage Blob Data Owner](../../role-based-access-control/built-in-roles.md#storage-blob-data-owner) role to your security principal, or give it permission to the `Microsoft.Storage/storageAccounts/blobServices/containers/blobs/tags/write` [Azure resource provider operation](../../role-based-access-control/resource-provider-operations.md#microsoftstorage) through a custom Azure role. If you're using a Shared Access Signature (SAS) token, the token must provide access to the blob's tags through the `t` SAS permission. To add tags, use the `--blob-tags` option with a URL encoded key-value pair. For example, to add the key `my tag` and the value `my tag value`, add `--blob-tags='my%20tag=my%20tag%20value'` to the destination parameter. Separate multiple index tags with an ampersand (`&`). For example, if you want to add the key `my second tag` and the 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 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 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 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 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. When the command returns, all files are copied. > [!NOTE] > If you specify a directory, container, or account for the source, all the blobs that you copy to the destination 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. |Scenario|Flag| |---|---| |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](https://github.com/Azure/azure-storage-azcopy/wiki/azcopy_copy#options). ## Specify source and destination types AzCopy uses the `--from-to` parameter to explicitly define the source and destination resource types when automatic detection might fail, such as in piping scenarios or emulators. This parameter helps AzCopy understand the context of the transfer and optimize accordingly. | FromTo Value | Description | |------------------------|---------------------------------------------------------------------------------------| | `BlobBlob` | Copy between two Azure Blob Storage locations | | `BlobBlobFS` | Copy from Azure Blob Storage to Azure Data Lake Gen2 (BlobFS) | | `BlobFSBlob` | Copy from Azure Data Lake Gen2 (BlobFS) to Azure Blob Storage | | `BlobFSBlobFS` | Copy between two Azure Data Lake Gen2 (BlobFS) locations | | `BlobFSFile` | Copy from Azure Data Lake Gen2 (BlobFS) to Azure File Storage | | `BlobFile` | Copy from Azure Blob Storage to Azure File Storage | | `FileBlob` | Copy from Azure File Storage to Azure Blob Storage | | `FileBlobFS` | Copy from Azure File Storage to Azure Data Lake Gen2 (BlobFS) | ## Next steps Find more examples in these articles: - [Examples: Upload](storage-use-azcopy-blobs-upload.md) - [Examples: Download](storage-use-azcopy-blobs-download.md) - [Examples: Synchronize](storage-use-azcopy-blobs-synchronize.md) - [Examples: Amazon S3 buckets](storage-use-azcopy-s3.md) - [Examples: Google Cloud Storage](storage-use-azcopy-google-cloud.md) - [Examples: Azure Files](storage-use-azcopy-files.md) See these articles to configure settings, optimize performance, and troubleshoot issues: - [AzCopy configuration settings](storage-ref-azcopy-configuration-settings.md) - [Optimize the performance of AzCopy](storage-use-azcopy-optimize.md) - [Find errors and resume jobs by using log and plan files in AzCopy](storage-use-azcopy-configure.md) - [Troubleshoot problems with AzCopy v10](storage-use-azcopy-troubleshoot.md) - [Use AzCopy to copy blobs between Azure storage accounts with network restrictions](/troubleshoot/azure/azure-storage/copy-blobs-between-storage-accounts-network-restriction?toc=/azure/storage/blobs/toc.json&bc=/azure/storage/blobs/breadcrumb/toc.json)
Success! Branch created successfully. Create Pull Request on GitHub
Error: