Get started with AzCopy
AzCopy is a command-line utility that you can use to copy blobs or files to or from a storage account. This article helps you download AzCopy, connect to your storage account, and then transfer files.
AzCopy V10 is the currently supported version of AzCopy.
If you need to use AzCopy v8.1, see the Use the previous version of AzCopy section of this article.
First, download the AzCopy V10 executable file to any directory on your computer.
For convenience, consider adding the directory location of the AzCopy executable to your system path for ease of use. That way you can type
azcopy from any directory on your system.
If you choose not to add the AzCopy directory to your path, you'll have to change directories to the location of your AzCopy executable and type
.\azcopy in Windows PowerShell command prompts.
To see a list of commands, type
azcopy -h and then press the ENTER key.
To learn about a specific command, just include the name of the command (For example:
azcopy list -h).
As an owner of your Azure Storage account, you aren't automatically assigned permissions to access data. Before you can do anything meaningful with AzCopy, you need to decide how you'll provide authorization credentials to the storage service.
Choose how you'll provide authorization credentials
You can provide authorization credentials by using Azure Active Directory (AD), or by using a Shared Access Signature (SAS) token.
Use this table as a guide:
|Storage type||Currently supported method of authorization|
|Blob storage||Azure AD & SAS|
|Blob storage (hierarchial namespace)||Azure AD only|
|File storage||SAS only|
Option 1: Use Azure AD
The level of authorization that you need is based on whether you plan to upload files or just download them.
If you just want to download files, then verify that the Storage Blob Data Reader has been assigned to your identity.
If you want to upload files, then verify that one of these roles has been assigned to your identity:
These roles can be assigned to your identity in any of these scopes:
- Container (file system)
- Storage account
- Resource group
To learn how to verify and assign roles, see Grant access to Azure blob and queue data with RBAC in the Azure portal.
You don't need to have one of these roles assigned to your identity if your identity is added to the access control list (ACL) of the target container or directory. In the ACL, your identity needs write permission on the target directory, and execute permission on container and each parent directory.
To learn more, see Access control in Azure Data Lake Storage Gen2.
Authenticate your identity
After you've verified that your identity has been given the necessary authorization level, open a command prompt, type the following command, and then press the ENTER key.
If you belong to more than one organization, include the tenant ID of the organization to which the storage account belongs.
azcopy login --tenant-id=<tenant-id>
<tenant-id> placeholder with the tenant ID of the organization to which the storage account belongs. To find the tenant ID, select Azure Active Directory > Properties > Directory ID in the Azure portal.
This command returns an authentication code and the URL of a website. Open the website, provide the code, and then choose the Next button.
A sign-in window will appear. In that window, sign into your Azure account by using your Azure account credentials. After you've successfully signed in, you can close the browser window and begin using AzCopy.
Option 2: Use a SAS token
You can append a SAS token to each source or destination URL that use in your AzCopy commands.
This example command recursively copies data from a local directory to a blob container. A fictitious SAS token is appended to the end of the of the container URL.
azcopy cp "C:\local\path" "https://account.blob.core.windows.net/mycontainer1/?sv=2018-03-28&ss=bjqt&srt=sco&sp=rwddgcup&se=2019-05-01T05:01:17Z&st=2019-04-30T21:01:17Z&spr=https&sig=MGCXiyEzbtttkr3ewJIh2AR8KrghSy1DGM9ovN734bQF4%3D" --recursive=true
To learn more about SAS tokens and how to obtain one, see Using shared access signatures (SAS).
After you've authenticated your identity or obtained a SAS token, you can begin transferring files.
To find example commands, see any of these articles.
Use AzCopy in a script
Over time, the AzCopy download link will point to new versions of AzCopy. If your script downloads AzCopy, the script might stop working if a newer version of AzCopy modifies features that your script depends upon.
To avoid these issues, obtain a static (un-changing) link to the current version of AzCopy. That way, your script downloads the same exact version of AzCopy each time that it runs.
To obtain the link, run this command:
--strip-components=1 on the
tar command removes the top-level folder that contains the version name, and instead extracts the binary directly into the current folder. This allows the script to be updated with a new version of
azcopy by only updating the
The URL appears in the output of this command. Your script can then download AzCopy by using that URL.
Use AzCopy in Storage Explorer
If you want to leverage the performance advantages of AzCopy, but you prefer to use Storage Explorer rather than the command line to interact with your files, then enable AzCopy in Storage Explorer.
In Storage Explorer, choose Preview->Use AzCopy for Improved Blob Upload and Download.
You don't have to enable this setting if you've enabled a hierarchical namespace on your storage account. That's because Storage Explorer automatically uses AzCopy on storage accounts that have a hierarchical namespace.
Storage Explorer uses your account key to perform operations, so after you sign into Storage Explorer, you won't need to provide additional authorization credentials.
Use the previous version of AzCopy
If you need to use the previous version of AzCopy (AzCopy v8.1), see either of the following links:
Configure, optimize, and troubleshoot AzCopy
If you have questions, issues, or general feedback, submit them on GitHub page.