0

Using azcopy to copy files into Azure Storage Container with "Blob Service SAS URL" Shared Access Signature.

Used to work couple of days back, now it stopped working. I have generated the SAS URL multiple times with proper start and end time.

Azure Version : 10.8.0

RESPONSE Status: 401 Server failed to authenticate the request.
Please refer to the information in the www-authenticate header.
Content-Length: [302]
Content-Type: [application/xml]
Date: [Wed, 17 Feb 2021 23:44:32 GMT]
Server: [Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0]
User-Agent: [AzCopy/10.8.0 Azure-Storage/0.10 (go1.13; linux)]
Www-Authenticate: [Bearer > authorization_uri= 
  https://login.microsoftonline.com/xxxxx/oauth2/authorize
  resource_id=https://storage.azure.com]
X-Ms-Client-Request-Id: [xxxxx]
X-Ms-Error-Code: [NoAuthenticationInformation]
X-Ms-Request-Id: [786b67cc-f01e-004d-1386-052f12000000]
X-Ms-Version: [2019-12-12]

Can someone please provide any workarounds?

SaschaM78
  • 4,376
  • 4
  • 33
  • 42

1 Answers1

1

Try to see this similar issue.

  1. Check your PC's time.
  2. Check the account key used to generate the SAS.
  3. Make sure your SAS token is valid.
  4. It's better to use the latest version of azure cli.

My test command with AzCopy v10:

$source_uri_with_sas = az storage blob generate-sas --account-key "source-account-key" --account-name "source-account-name" --container-name "source-container-name" --expiry 2022-01-01T00:00:00Z --name "source-blob-name" --permissions acdrw --full-uri

$destination_uri_with_sas = az storage blob generate-sas --account-key "destination-account-key" --account-name "destination-account-name" --container-name "destination-container-name" --expiry 2022-01-01T00:00:00Z --name "destination-blob-name" --permissions acdrw --full-uri

# Copy blob between storage accounts
azcopy copy $source_uri_with_sas $destination_uri_with_sas --recursive=true
unknown
  • 6,778
  • 1
  • 5
  • 14