Copy or move data to Azure Storage by using AzCopy v10 | Microsoft Learn
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 data.
Authorize AzCopy
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:
Can download, but used the portal for this test.
Option 1: Use Azure Active Directory
This option is available for blob Storage only. By using Azure Active Directory, you can provide credentials once instead of having to append a SAS token to each command.
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 container URL.
azcopy copy "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
Test 1 all is enabled
Get SAS
You must select service, resource types and permission, else there will be no SAS
Warning
Fileshare
Copy a folder from home to the storage account’s fileshare
Upload a directory
# Upload a directory to fs
azcopy copy '<local-directory-path>' 'https://<storage-account-name>.file.core.windows.net/<file-share-name><SAS-token>' --recursive
cmd
# Upload a directory to fs
azcopy copy folder1 "https://storageaccount01041.file.core.windows.net/fileshare0041/?sv=2021-12-02&ss=bfqt&srt=sco&sp=rwdlacupiytfx&se=2023-04-10T23:13:59Z&st=2023-04-09T15:13:59Z&spr=https&sig=ahDw1sxECGSV4c6P%2BRLkL3YQVXoa7ycGSoRT2pfF6vQ%3D" --recursive
Test 2 edit and get SAS token
Result is false
azcopy copy folder1 "https://storageaccount01041.file.core.windows.net/fileshare0041/?sv=2021-12-02&ss=bqt&srt=sco&sp=rwdlacupiytfx&se=2023-04-10T23:30:45Z&st=2023-04-09T15:30:45Z&spr=https&sig=9qYnyrdVgXzR3NMUEfx0Ba%2BpwsyyNTH8amR6iNjL2Ys%3D" --recursive
#Result
RESPONSE Status: 403 This request is not authorized to perform this operation using this service.
Final Job Status: Cancelled
Test 3 edit and get SAS token
Same result, false
Test 4 edit and get SAS token
Same result, false
Test 5 edit and get SAS token
Result is true
Azure – SAS Terms – Microsoft Q&A
Service (s): Access to service-level APIs (e.g., Get/Set Service Properties, Get Service Stats, List Containers/Queues/Tables/Shares)
Container (c): Access to container-level APIs (e.g., Create/Delete Container, Create/Delete Queue,
Object (o): Access to object-level APIs for blobs, queue messages, table entities, and files(e.g. Put Blob, Query Entity, Get Messages, Create File, etc.)