Skip to content

Az lab azcopy SAS

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" "" --recursive=true

Test 1 all is enabled


You must select service, resource types and permission, else there will be no SAS



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-share-name><SAS-token>' --recursive


# Upload a directory to fs

azcopy copy folder1 "" --recursive

Test 2 edit and get SAS token

Result is false

azcopy copy folder1 "" --recursive

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.)

Published inazurelab