Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

azure-storage-azcopy doesn't work with the SAS token.

Edited

It seems like it is not parsing correctly which could be a problem of azcopy itself https://github.com/Azure/azure-storage-azcopy/issues/122 or the "pipe" itself. 

I have tried several different date formats.

&se=2028-01-01
&se=2039-01-01T08:00:00Z

Yet, there is still an error.

   AuthenticationErrorDetail: se is mandatory. Cannot be empty.

Using the exact same command and SAS token locally works perfectly.

The PUT URL it creates doesn't have the `se` query parameter though it's the SAS token!

 PUT https://xyz.blob.core.windows.net/$web/robots.txt?sig=-REDACTED-&sp=rwdlacu&spr=https&srt=o&ss=b&sv=2017-07-29&timeout=901

 

 

 

1 answer

0 votes

@Thomas Beauvais it seems like it is azure issue, because our pipe only copies and if the token is not validated by azure, it is either token or azure problem. Our tokens generated are working properly.

However, haven't you tried to generate sas token via azure portal?

Thanks for the reply. 

The trouble is that the azcopy CLI (10.5.0) works with the same token (sorry that I failed to mention that).

The token I am using is in the format of the console. The discrepancy seems like it is in some transform somewhere or a version mismatch.

@Thomas Beauvais try, please, the next command for generating the token

 

 az storage container generate-sas --name <container_name> --account-name <storage_account_name> --expiry ${SAS_TOKEN_EXPIRY} --permissions ${PERMISSIONS} | sed 's/["\t]//g
where PERMISSIONS is 'rw', for example or other permissions you would l like to have,
and sas token expire date, for example, can be :
SAS_TOKEN_EXPIRY=$(date -d "60 minutes" '+%Y-%m-%dT%H:%M:%SZ')

 

I suspect, removing \t, it worked for me. I think, It is that specific way how azcopy works with token in shell (depending on shell), because sometimes they do not ignore some spaces etc.

Using rest api is more complicated here, but you could try also to use sed for the token in some way after executing PUT.

Looking forward to hearing back.

also you can refer to examples, azure is recommending to use https://docs.microsoft.com/en-us/cli/azure/storage/container?view=azure-cli-latest#az-storage-container-generate-sas-examples ,

but I think still attention to spaces , \t, \n etc. should be paid

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Posted in Trello

Taco Tuesday: Your favorite Trello blog takeaway

Hello friends! From the community that brought you Welcome Wednesday, Throwback Thursday and Friday Fun, welcome to Taco Tuesday, a weekly discussion about all things Trello. The best part? One Tac...

67 views 4 3
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you