-1

I'm trying to download files to a vm running CentOS on azure. The linux box has azcopy installed. I'm trying to download files from azure file storage using a generated SAS token, but its failing to download. Am I misunderstanding how to use the SAS token?

Ultimately I was able to download the file using the key instead of the SAS token. So I know the url was correct.

I created a sas token for the storage account with the public ip of the linux vm, then copied and appended that to the file url. I've created a CORS rule for allowing all ip addresses. I repeated this on my local machine (with its public ip) and was able to get the file. When I run the same command on the vm it fails.

I tried running this with the sas token appended to the url, and passing it in as a separate param.

azcopy --source "https://mynamehere.file.core.windows.net/pathtofile/file" --source-sas "?sv=2018-03-28&ss=...&srt =...&sp=...&se=2019-04-04T21:53:38Z&st=2019-04-04T13:53:38Z&sip=...&spr=https&sig=..." --destination file --verbose

I keep getting

[VERBOSE] Location 'Cloud file: https://mynamehere.file.core.windows.net/pathtofile/file' does not exist, This request is not authorized to perform this operation.
HttpStatusMessage:This request is not authorized to perform this operation.

and

[ERROR] Error parsing source location "https://mynamehere.file.core.windows.net/pathtofile/file": Source with location type File doesn't exist.
user2503038
  • 193
  • 1
  • 2
  • 8
  • Can you share the actual SAS token? Just remove the signature portion. I’m curious to see what parameters were used to create SAS token. – Gaurav Mantri Apr 04 '19 at 17:03
  • here is one of the ones i have saved off in my notes: ?sv=2018-03-28&ss=f&srt=sco&sp=rl&se=2019-04-04T04:13:39Z&st=2019-04-03T20:13:39Z&sip={public ip of vm}&spr=https&sig={...} – user2503038 Apr 04 '19 at 17:59

1 Answers1

0

pleas check the permission (read, write, delete) and expiry time for the sas token you are using to access the storage

Gladiator
  • 23
  • 8
  • I had originally tried to set minimal permissions (read-only, files only, etc), but after that didn't work I tried the defaults as well (every permission selected). Expiry time through the portal is set in utc and looked like a several hour window (I used it immediately after creating the SAS token). – user2503038 Apr 04 '19 at 17:58