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

 

  • 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

Â