AzCopy
Intro
My notes for using AzCopy to move data to a storage account
Â
Documentation
Â
Tips and Tidbits
AzCopy is a command-line utility that you can use to copy blobs or files to or from a storage account.Â
You can provide authorization credentials by using Azure Active Directory (AD), or by using a Shared Access Signature (SAS) token.
Â
Copy blobs between Azure storage accounts by using AzCopy
Â
You can copy blobs, directories, and containers between storage accounts by using the AzCopy v10 command-line utility.
Append a SAS token to each source URL.
If you provide authorization credentials by using Azure Active Directory (Azure AD), you can omit the SAS token only from the destination URL.
Resume A Job
azcopy jobs resume <job-id> --source-sas="<sas-token>" --destination-sas="<sas-token>"
When you resume a job, AzCopy looks at the job plan file.
The plan file lists all the files that were identified for processing when the job was first created.
When you resume a job, AzCopy will attempt to transfer all of the files that are listed in the plan file which weren't already transferred.
Download AzCopy Via PowerShell
Â
$url = 'https://aka.ms/downloadazcopy-v10-windows'
$zipFile = '.\azcopy.zip'
Invoke-WebRequest -Uri $Url -OutFile $zipFile
Expand-Archive -Path $zipFile -DestinationPath '.\'
Set-Location -Path 'azcopy*'
Â
AzCopy Login
Â
.\azcopy.exe login
To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code A2FXA3SWC to authenticate.
INFO: Logging in under the "Common" tenant. This will log the account in under its home tenant.
INFO: If you plan to use AzCopy with a B2B account (where the account's home tenant is separate from the tenant of the target storage account), please sign in under the target tenant with --tenant-id
Â
Authenticate as an Azure AD user with Blob permissions (
az30306auser1@rogerrcruzyahoo.onmicrosoft.com
)
Â
Upload File
Â
Â
Note that only AzCopy is authorized. You can’t access the URI
Â