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.
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
https://aka.ms/downloadazcopy-v10-windowsDownloadhttps://aka.ms/downloadazcopy-v10-macDownloadhttps://aka.ms/downloadazcopy-v10-linuxDownloadInstall instructions
https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-v10Install stepsAlso 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
9 steps
- 1
Download and extract AzCopy
Where: Your PC or server, in a web browser, then File Explorer or FinderDownload the file for your system from the links above (for Windows 64-bit,
https://aka.ms/downloadazcopy-v10-windows). Extract the archive and moveazcopy.exe(Windows) orazcopy(macOS/Linux) to a folder such asC:\Tools\AzCopyor/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\AzCopyYou should see: azcopy.exe (or azcopy) is in the folder you chose. - 2
Add AzCopy to your PATH
Where: Windows: Start > search "Edit the system environment variables" > Environment Variables. macOS/Linux: TerminalMicrosoft suggests adding the AzCopy folder to your path so you can type
azcopyfrom any directory. On Windows, select Path under User variables, Edit, New, enterC:\Tools\AzCopyand select OK. On macOS or Linux, copying the binary to/usr/local/binis enough. If you skip this step, change to the AzCopy folder and run.\azcopyinstead. Open a new terminal and check it works.azcopy -hYou should see: AzCopy prints its list of commands (copy, sync, login, jobs, make and others). - 3
Choose how to authorise
Where: Azure portal > Storage accounts > your account > Access control (IAM), or > Shared access signatureOption 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
Sign in with azcopy login (Entra ID only)
Where: PowerShell, Command Prompt or Terminal on the machine running AzCopyRun
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-000000000000You should see: After signing in in the browser you can close it and the terminal reports the login succeeded. - 5
Create the container if needed
Where: The same terminalSkip 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
Copy a folder to Blob storage
Where: The same terminalCopy 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>' --recursiveYou should see: AzCopy shows a job ID, progress, then a summary of completed, failed and skipped transfers. - 7
Or copy a folder to an Azure file share
Where: The same terminalUse the
file.core.windows.netendpoint.--preserve-permissions=truecopies the ACLs and--preserve-info=truecopies SMB property information.azcopy copy 'C:\myDirectory' 'https://mystorageaccount.file.core.windows.net/myfileshare?<SAS-token>' --recursive --preserve-permissions=true --preserve-info=trueYou should see: A myDirectory folder appears in the file share with the same contents. - 8
Keep the destination up to date with sync
Where: The same terminalazcopy syncis 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=truedeletes files that no longer exist at the source without prompting; usepromptto 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=promptYou should see: Only new or changed files are transferred and the summary shows the number copied. - 9
Check and resume jobs
Where: The same terminalEach 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.
Expert tips
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.
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.
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.
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).
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.
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.
How to reverse it
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.
Errors you might see
azcopy login fails with an errorCause: 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 LinuxCause: 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 changedCause: Sync compares last modified times and the clock on the machine is wrong.
Fix: Correct the system clock or rerun with --compare-hash.
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.
Official sources
Vendors change menus and requirements. Confirm on the source before you rely on a detail. Last checked 4 Nov 2026.