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.

Note

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.

Download AzCopy

First, download the AzCopy V10 executable file to any folder on your computer. For convenience, consider adding the AzCopy folder location to your system path for ease of use.

Note

If you want to copy data to and from your Azure Table storage service, then install AzCopy version 7.3.

Run AzCopy

From a command prompt, navigate to the directory where you downloaded the file.

To view a list of AzCopy commands, type azCopy, and then press the ENTER key.

To learn more about a specific command, type azCopy followed by the name of the command.

For example, to learn about the copy command, type azcopy copy, and then press the ENTER key.

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.

Authorization to upload files

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
  • Subscription

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 folder. In the ACL, your identity needs write permission on the target folder, and execute permission on container and each parent folder.

To learn more, see Access control in Azure Data Lake Storage Gen2.

Authorization to download files

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
  • Subscription

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 folder. In the ACL, your identity needs read permission on the target folder, and execute permission on container and each parent folder.

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.

azcopy login

This command returns an authentication code and the URL of a website. Open the website, provide the code, and then choose the Next button.

Create a container

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).

Transfer files

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.

Configure, optimize, and troubleshoot AzCopy

See Configure, optimize, and troubleshoot AzCopy

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.

Enable AzCopy as a transfer engine in Azure Storage Explorer

Note

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.

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:

Next steps

If you have questions, issues, or general feedback, submit them on GitHub page.