How-to · Azure

Copy files to Azure Storage with AzCopy v10

At the end you will have AzCopy on your machine, be authorised to your storage account, and have copied or synchronised a local folder to a blob container or an Azure file share, with a way to check and resume the job.

Updated 9 steps5 official sources
Before you start

What you need before step 1

Applies to: AzCopy v10 on Windows, macOS and Linux with Azure Blob storage and Azure Files (as documented by Microsoft)

Admin roles you need

  • To upload to Blob storage with Microsoft Entra ID: Storage Blob Data Contributor or Storage Blob Data Owner on the storage account or container
  • To upload to Azure Files with Microsoft Entra ID: Storage File Data Privileged Contributor
  • To download only: Storage Blob Data Reader (Blob) or Storage File Data Privileged Reader (Azure Files)
  • Or, instead of a role: a SAS token for the container or share with the permissions you need

Licences

None needed.

Download

AzCopy v10 for Windows 64-bit (zip)Also available: -windows-32bit and -windows-arm64https://aka.ms/downloadazcopy-v10-windowsDownload
AzCopy v10 for macOS (zip)Apple silicon: https://aka.ms/downloadazcopy-v10-mac-arm64https://aka.ms/downloadazcopy-v10-macDownload
AzCopy v10 for Linux x86-64 (tar)ARM64: https://aka.ms/downloadazcopy-v10-linux-arm64. Microsoft says a package manager install is also available on Linuxhttps://aka.ms/downloadazcopy-v10-linuxDownload

Install instructions

Copy or move data to Azure Storage by using AzCopy v10 (Microsoft Learn)Download page and command listhttps://learn.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-v10Install steps

Also have ready

  • An existing storage account, and its name (for example mystorageaccount)
  • Your Microsoft Entra tenant ID if sign-in fails (Azure portal > Microsoft Entra ID > Overview > Tenant properties > Tenant ID)
  • Microsoft notes AzCopy does not support source or destination data that is being changed during the transfer
  • If you are importing PST files to Microsoft 365, use the AzCopy version linked on the Microsoft 365 import page, not this general download
Step by step

9 steps

  1. 1

    Download and extract AzCopy

    Where: Your PC or server, in a web browser, then File Explorer or Finder

    Download the file for your system from the links above (for Windows 64-bit, https://aka.ms/downloadazcopy-v10-windows). Extract the archive and move azcopy.exe (Windows) or azcopy (macOS/Linux) to a folder such as C:\Tools\AzCopy or /usr/local/bin. On Windows, the commands below do the same in PowerShell.

    Invoke-WebRequest -Uri https://aka.ms/downloadazcopy-v10-windows -OutFile .\azcopy.zip
    Expand-Archive .\azcopy.zip -DestinationPath .\azcopy
    New-Item -ItemType Directory -Force C:\Tools\AzCopy
    Get-ChildItem .\azcopy -Recurse -Filter azcopy.exe | Copy-Item -Destination C:\Tools\AzCopy
    You should see: azcopy.exe (or azcopy) is in the folder you chose.
  2. 2

    Add AzCopy to your PATH

    Where: Windows: Start > search "Edit the system environment variables" > Environment Variables. macOS/Linux: Terminal

    Microsoft suggests adding the AzCopy folder to your path so you can type azcopy from any directory. On Windows, select Path under User variables, Edit, New, enter C:\Tools\AzCopy and select OK. On macOS or Linux, copying the binary to /usr/local/bin is enough. If you skip this step, change to the AzCopy folder and run .\azcopy instead. Open a new terminal and check it works.

    azcopy -h
    You should see: AzCopy prints its list of commands (copy, sync, login, jobs, make and others).
  3. 3

    Choose how to authorise

    Where: Azure portal > Storage accounts > your account > Access control (IAM), or > Shared access signature

    Option A, Microsoft Entra ID: assign yourself the role listed under Before you start (Access control (IAM) > Add > Add role assignment). Microsoft says role assignments can take up to five minutes to propagate. Option B, SAS token: generate a SAS for the container or share and append it to each URL in your AzCopy commands. Commands that target only an Azure file share or the whole account still need a SAS.

    You should see: You have either a role assignment on the account or a SAS token string beginning with ?sv=.
  4. 4

    Sign in with azcopy login (Entra ID only)

    Where: PowerShell, Command Prompt or Terminal on the machine running AzCopy

    Run azcopy login. AzCopy returns a code and a website URL. Open the website, enter the code, select Next and sign in. If you get an error, add your tenant ID. Microsoft notes the command stores the token in the system secret store, so it fails on Linux systems with no keyring; in that case use a SAS or the AZCOPY_AUTO_LOGIN_TYPE variables described on the Microsoft page.

    azcopy login
    azcopy login --tenant-id=00000000-0000-0000-0000-000000000000
    You should see: After signing in in the browser you can close it and the terminal reports the login succeeded.
  5. 5

    Create the container if needed

    Where: The same terminal

    Skip this if the container already exists.

    azcopy make 'https://mystorageaccount.blob.core.windows.net/mycontainer'
    You should see: AzCopy confirms the container was created.
  6. 6

    Copy a folder to Blob storage

    Where: The same terminal

    Copy the local folder and all subfolders with --recursive. The first line uses Entra ID. To use a SAS instead, append the token to the container URL (second line).

    azcopy copy 'C:\myDirectory' 'https://mystorageaccount.blob.core.windows.net/mycontainer' --recursive
    azcopy copy 'C:\myDirectory' 'https://mystorageaccount.blob.core.windows.net/mycontainer?<SAS-token>' --recursive
    You should see: AzCopy shows a job ID, progress, then a summary of completed, failed and skipped transfers.
  7. 7

    Or copy a folder to an Azure file share

    Where: The same terminal

    Use the file.core.windows.net endpoint. --preserve-permissions=true copies the ACLs and --preserve-info=true copies SMB property information.

    azcopy copy 'C:\myDirectory' 'https://mystorageaccount.file.core.windows.net/myfileshare?<SAS-token>' --recursive --preserve-permissions=true --preserve-info=true
    You should see: A myDirectory folder appears in the file share with the same contents.
  8. 8

    Keep the destination up to date with sync

    Where: The same terminal

    azcopy sync is one-way and by default compares file names and last modified times, so the machine needs an accurate clock (or add --compare-hash). --delete-destination=true deletes files that no longer exist at the source without prompting; use prompt to be asked, and turn on soft delete first. Microsoft says sync is supported but not fully recommended for Azure Files.

    azcopy sync 'C:\myDirectory' 'https://mystorageaccount.blob.core.windows.net/mycontainer' --recursive
    azcopy sync 'C:\myDirectory' 'https://mystorageaccount.blob.core.windows.net/mycontainer' --recursive --delete-destination=prompt
    You should see: Only new or changed files are transferred and the summary shows the number copied.
  9. 9

    Check and resume jobs

    Where: The same terminal

    Each run is a job with log and plan files. List jobs, show the details of one, and resume it if it stopped part way.

    azcopy jobs list
    azcopy jobs show <job-id>
    azcopy jobs resume <job-id>
    You should see: jobs list shows each job ID with its status; jobs resume continues the transfer from where it stopped.
From experience

Expert tips

Resume a SAS job by passing the tokens again

azcopy jobs resume <job-id> retries every file in the job plan that was not already transferred, so you never restart a large copy from zero. Microsoft notes the SAS token is not stored for security reasons, so for a SAS job add it again: azcopy jobs resume <job-id> --source-sas="<sas>" --destination-sas="<sas>". Jobs authorised with azcopy login resume without it.

Know where the logs and plan files live

By default they are in %USERPROFILE%\.azcopy on Windows and $HOME/.azcopy on macOS and Linux. On a long migration they can grow large, so point them at a data disk with AZCOPY_LOG_LOCATION and AZCOPY_JOB_PLAN_LOCATION before you start. Do not delete plan files for a job you may still need to resume; azcopy jobs clean removes them all.

Find the real error, not the first one

AzCopy retries network, timeout and server busy errors up to 20 times, so the first error in the log is often harmless. Search for UPLOADFAILED, COPYFAILED or DOWNLOADFAILED (for example Select-String UPLOADFAILED .\<job-id>.log) and read the lines near them, or list only the failures with azcopy jobs show <job-id> --with-status=Failed (the value is case-sensitive). The start of each log holds a redacted copy of the command, which is the safe version to share with support.

Tune concurrency with a benchmark first

AzCopy uses 32 concurrent requests on machines with fewer than five CPUs, otherwise 16 per CPU up to a default maximum of 300. Run azcopy benchmark 'https://<account>.blob.core.windows.net/<container>' to get a recommended value, then set AZCOPY_CONCURRENCY_VALUE, or set it to AUTO if network conditions vary. Use --cap-mbps to leave bandwidth for users during business hours (uploads and downloads only, not account to account copies).

Split huge file sets into smaller jobs

Microsoft recommends fewer than 10 million files per job and warns that jobs over 50 million files can perform poorly. Run one job per top-level folder. For many small files, add --log-level=ERROR to keep logs small and consider --check-length=false. For repeat passes over a large tree, azcopy copy --overwrite=ifSourceNewer avoids the up-front scan that sync does.

Check it worked

How to confirm it worked

  • In the Azure portal open Storage accounts > your account > Containers (or File shares) > your container and check the folders and file count match the source.

  • Run azcopy jobs show <job-id> and check there are no failed transfers.

Undo

How to reverse it

Rollback:

A copy cannot be undone by AzCopy itself. Delete the copied data in the Azure portal (Containers or File shares > select the items > Delete). If you used sync --delete-destination=true, deleted destination files can only be recovered if soft delete was turned on. To clean up AzCopy's own log and plan files run azcopy jobs clean, and delete the AzCopy folder to uninstall it.

Troubleshooting

Errors you might see

azcopy login fails with an error

Cause: AzCopy cannot work out the right tenant.

Fix: Run azcopy login --tenant-id= followed by your tenant ID, using the Tenant ID from Microsoft Entra ID > Overview > Tenant properties.

azcopy login does not work on Linux

Cause: The system has no secret store (keyring) to hold the token.

Fix: Use a SAS token, or set AZCOPY_AUTO_LOGIN_TYPE=DEVICE (or AZCLI with AZCOPY_TENANT_ID) as Microsoft documents.

Authorisation failures right after assigning a role (symptom)

Cause: Role assignments can take up to five minutes to propagate.

Fix: Wait five minutes and retry. Check the role is a data role such as Storage Blob Data Contributor, not just Contributor.

Files skipped by sync even though they changed

Cause: Sync compares last modified times and the clock on the machine is wrong.

Fix: Correct the system clock or rerun with --compare-hash.

FAQ

Questions

Should I use copy or sync?

Microsoft suggests copy with --overwrite=ifSourceNewer when you do not need deletions mirrored, because copy does not index the source and destination first and uses less memory.

Does AzCopy work with Azure Files and Entra ID?

Yes for commands that target files and directories. Commands that target only the share or the account still need a SAS token.

Can AzCopy rename files?

No. Microsoft says AzCopy does not have a command to rename files.

How do I turn off AzCopy telemetry?

From v10.34.0 add --disable-telemetry=true.

Sources

Official sources

Vendors change menus and requirements. Confirm on the source before you rely on a detail. Last checked 4 Nov 2026.