Home > Net >  Download a file from sas token
Download a file from sas token

Time:06-07

I have created a storage_account with a container named data. In that container I have a single .zip file.

I'm generating an Account Key SAS Token with Read permission directly on the data container :

enter image description here

The Blob SAS URL looks like this :

https://<STORAGE_ACCOUNT>.blob.core.windows.net/data?sp=r&st=2022-06-06T15:23:31Z&se=2022-06-06T23:23:31Z&spr=https&sv=2020-08-04&sr=c&sig=<SIGNATURE>

How am I supposed to download my zip file from that URI?

I'm always running into some Authorization error whereas I though having the link was enough and unfortunately documentation didn't help me to figure out what's wrong.

I would like to download the file from a HTTP call, not using az copy or powershell.

CodePudding user response:

from your description and the URL you provided, I guess the issue is that you didn't reference the name of the zip file in the URL

so instead of

https://<STORAGE_ACCOUNT>.blob.core.windows.net/data?sp=r&st=2022-06-06T15:23:31Z&se=2022-06-06T23:23:31Z&spr=https&sv=2020-08-04&sr=c&sig=<SIGNATURE>

try

https://<STORAGE_ACCOUNT>.blob.core.windows.net/data/zipName?sp=r&st=2022-06-06T15:23:31Z&se=2022-06-06T23:23:31Z&spr=https&sv=2020-08-04&sr=c&sig=<SIGNATURE>
  • Related