
Azure AzCopy is a powerful command-line tool that simplifies the process of transferring data between Azure Blob, File, and Table storage, as well as on-premises file systems.
To get started with Azure AzCopy, you'll need to download and install it from the official Microsoft download center. This will give you access to the AzCopy.exe file, which is the core of the tool.
Once you've installed AzCopy, you can use it to transfer data between Azure storage services and on-premises file systems, including Windows and Linux servers. AzCopy supports various transfer options, including synchronous and asynchronous transfers.
To begin using AzCopy, you'll need to specify the source and destination for your data transfer. This can be done using the AzCopy command-line interface, which allows you to specify the source and destination paths, as well as other options such as the transfer mode and authentication method.
Take a look at this: Azure Data Studio vs Azure Data Explorer
Installation
To install AzCopy, you have a few options. You can install it on Linux using a package manager, which is a great way to get started.
For RHEL, you can use dnf to install AzCopy. OpenSUSE and SLES users can use zypper, while Ubuntu and Debian users can use apt. If you're running Azure Linux, you can use tdnf.
If you're not comfortable with package managers, you can download the latest version of AzCopy from the official website. Just head to the "Get started with AzCopy" page to get the latest version.
To install AzCopy on Windows, you can run a PowerShell script. This will add the AzCopy folder location to your system path, making it easy to run AzCopy commands from anywhere.
Alternatively, you can download the zip file and run it from wherever you want. This gives you more flexibility in how you install and use AzCopy.
On Linux, you can install AzCopy by running a shell script. This will put the AzCopy executable into the /usr/bin folder, making it easy to run AzCopy commands from anywhere.
Here's a quick rundown of the package managers you can use to install AzCopy on Linux:
Authorization
Authorization with Azure AzCopy is a crucial step in transferring data between your local machine and Azure Storage. You can provide authorization credentials by using Microsoft Entra ID or by using a Shared Access Signature (SAS) token.
To authorize with Azure Storage, you have two options: Azure Active Directory (AD) or a SAS token. Azure AD is supported for blob storage and hierarchical namespace blob storage, while SAS is supported for file storage. You can also use a SAS token to append to each source or destination URL in your AzCopy commands.
AzCopy v10 supports the /XO and /XA commands, which can be used to copy new files and exclude previous ones. However, the sync command does not work with file shares, so you may need to use these commands instead.
If you're working with Azure Blob Storage, you can use Azure AD or a SAS token for authentication. To use Azure AD, you can use the command `Connect-AzAccount` followed by `Select-AzSubscription` and `Get-AzStorageAccountKey`. To use a SAS token, you can generate one using Azure PowerShell and append it to the end of the container URL.
Here's a table summarizing the supported methods for each storage type:
Usage and Options
AzCopy is a flexible tool that can be used for one-time copy activities and ongoing synchronization scenarios. You can use it to copy data from an on-premises source to an Azure storage account, from an Azure storage account to an on-premises source, or from one storage account to another.
AzCopy has native commands for copying and/or synchronizing data, making it a versatile tool for various use cases. You can target specific storage services such as Azure Blob Storage or Azure Files, allowing you to copy data from blob to file, file to blob, file to file, and more.
Here are some common use cases for AzCopy:
- Copying data from an on-premises source to an Azure storage account
- Copying data from an Azure storage account to an on-premises source
- Copying data from one storage account to another storage account
You can also use AzCopy to upload files to Azure Blob storage, download blobs from Azure Blob Storage, copy blobs between Azure storage accounts, or synchronize with Azure Blob storage.
Use Cases
AzCopy is a powerful tool that offers a range of use cases for copying data to, from, or between Azure storage accounts.

You can use AzCopy to copy data from an on-premises source to an Azure storage account, or from an Azure storage account to an on-premises source. It's also great for copying data between different storage accounts.
AzCopy has native commands for copying and synchronizing data, making it a flexible tool for one-time copy activities and ongoing synchronization scenarios.
Here are some specific use cases for AzCopy:
- Copying data from an on-premises source to an Azure storage account
- Copying data from an Azure storage account to an on-premises source
- Copying data from one storage account to another storage account
AzCopy also allows you to target specific storage services, such as Azure Blob Storage or Azure Files, giving you the flexibility to copy data between different storage types.
Some common use cases for AzCopy include uploading files to Azure Blob storage, downloading blobs from Azure Blob Storage, and synchronizing with Azure Blob storage.
Here are some specific examples of what you can do with AzCopy:
- Upload files to Azure Blob storage by using AzCopy
- Download blobs from Azure Blob Storage by using AzCopy
- Copy blobs between Azure storage accounts by using AzCopy
- Synchronize with Azure Blob storage by using AzCopy
Keep in mind that AzCopy doesn't support scenarios where the source or destination is being actively changed during the transfer.
List of Commands

AzCopy has a wide range of commands that can be used to perform various tasks. You can run a performance benchmark by uploading or downloading test data to or from a specified location with the azcopy bench command.
The azcopy copy command is used to copy source data to a destination location. AzCopy also has a command to generate documentation for the tool in Markdown format, which is azcopy doc.
To show the environment variables that can configure AzCopy's behavior, you can use the azcopy env command. This is useful when you need to troubleshoot issues or customize the tool's behavior.
Here's a list of some of the key commands:
AzCopy does not have a command to rename files, so you'll need to find an alternative solution for that task.
Static Link
To get a static download link for AzCopy, you can run a command that points to the current version of AzCopy. This way, your script downloads the same exact version each time it runs.

The command to obtain the link varies depending on your operating system. For Linux, you can use the following command: curl -s -D- https://aka.ms/downloadazcopy-v10-linux | grep ^Location
For Windows PowerShell, the command is: (Invoke-WebRequest -Uri https://aka.ms/downloadazcopy-v10-windows -MaximumRedirection 0 -ErrorAction SilentlyContinue).headers.location
PowerShell 6.1+ users can also use: (Invoke-WebRequest -Uri https://aka.ms/downloadazcopy-v10-windows -MaximumRedirection 0 -ErrorAction SilentlyContinue -SkipHttpErrorCheck).headers.location
The URL for the download will appear in the output of this command, which your script can then use to download AzCopy.
Here's a quick reference to the commands for each operating system:
Note that for Linux, using --strip-components=1 on the tar command removes the top-level folder that contains the version name, allowing the script to be updated with a new version of azcopy by only updating the wget URL.
Optional Flags
You can tweak your download operation by using optional flags. These flags allow you to customize the download process to suit your needs.
You can automatically decompress files by using the --decompress flag. This can save you time and effort, especially when working with large archives.
To specify how detailed you want your copy-related log entries to be, use the --log-level flag with one of the following options: WARNING, ERROR, INFO, or NONE. I've found this to be particularly useful when troubleshooting issues.
To specify if and how to overwrite conflicting files and blobs at the destination, use the --overwrite flag with one of the following options: true, false, ifSourceNewer, or prompt. This can help prevent data loss and ensure a smooth download process.
Here are the optional flags and their uses summarized in a table:
Specify Multiple Blob Names
You can specify multiple complete blob names using the azcopy copy command with the --include-path option.
Separate individual blob names by using a semicolon (;) to include multiple complete blob names in the transfer.
This allows you to transfer specific blobs from your cloud storage to your local directory.
For example, you can use the --include-path option to transfer the "https://mystorageaccount.blob.core.chinacloudapi.cn/mycontainer/FileDirectory/photos" directory and the "https://mystorageaccount.blob.core.chinacloudapi.cn/mycontainer/FileDirectory/documents/myFile.txt" file.
You can also exclude blobs by using the --exclude-path option.
To learn more about excluding blobs, see the reference docs for the azcopy copy command.
You can include the --recursive option to transfer all blobs in the specified directory, which is useful for transferring large directory trees.
Frequently Asked Questions
What is the difference between AzCopy and Azure file sync?
AzCopy is for bulk data transfer between Azure storage types, whereas Azure File Sync synchronizes files between Azure and on-premises systems. This difference in purpose makes each tool ideal for distinct use cases in cloud and hybrid environments.
What is the difference between Azure CLI and AzCopy?
AzCopy is a command-line utility for high-performance data transfer, while Azure CLI and Azure PowerShell are more user-friendly options for executing control plane operations. AzCopy is ideal for data plane operations, whereas Azure CLI and Azure PowerShell are better suited for control plane operations.
What is the difference between RoboCopy and AzCopy?
RoboCopy uses the SMB protocol, while AzCopy relies on the REST protocol, making them fundamentally different file copy tools. AzCopy is specifically designed for Azure storage, offering a unique cloud-based data transfer solution.
Sources
- https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-v10
- https://github.com/Azure/azure-storage-azcopy
- https://www.thomasmaurer.ch/2019/05/how-to-install-azcopy-for-azure-storage/
- https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-blobs-properties-metadata
- https://docs.azure.cn/en-us/storage/common/storage-use-azcopy-blobs-download
Featured Images: pexels.com