Azure – Is it possible to download a file using a Powershell DSC resource from Azure File storage account

azureazure-storagedsc

I have a file in an Azure File storage. I would like to download it using a DSC resource (xRemoteFile, for example).

The Azure File storage gives me an HTTPS url to that file, but it is not directly usable:

enter image description here

EDIT 1

Using SAS:

enter image description here

Next I am trying to use the SAS URL:

enter image description here

Still no dice.

EDIT 2

As you can see from the snapshots, the SasToken is

?sv=2017-07-29&ss=f&srt=o&sp=r&se=2020-05-10T00:41:14Z&st=2018-05-09T16:41:14Z&spr=https&sig=...

and the URL is

https://***.file.core.windows.net/?sv=2017-07-29&ss=f&srt=o&sp=r&se=2020-05-10T00:41:14Z&st=2018-05-09T16:41:14Z&spr=https&sig=...

i.e. the SasToken is appended to https://***.file.core.windows.net/

Best Answer

I can't tell from the screenshot if you are, but you need to specify a SaS token. Azure File shares have the ACL set to private and you cannot change that, so you can't download the file anonymously. You need to generate a SaS token for authentication and then use that in your URL.

You can generate a SaS token directly in the Azure portal now.