6

I'm trying to access files which I'm programmatically uploading to the azure file storage.

But when pasting the direct url:

enter image description here

Any idea how I can directly get that file when I want to download from Azure file storage?

halfer
  • 19,824
  • 17
  • 99
  • 186
Laziale
  • 7,965
  • 46
  • 146
  • 262

1 Answers1

9

Direct access to files stored in file service is not allowed because the share containing these files has Private ACL and unlike blob containers there's no way to change the ACL of a share.

What you would need to do is create a Shared Access Signature (SAS) on the file that you want to access directly and use that SAS URL. When creating the SAS, please ensure that at least Read permission is included in the SAS as this permission is required to read/download the file.

Please see https://azure.microsoft.com/en-in/documentation/articles/storage-dotnet-how-to-use-files/#develop-with-file-storage (Generate a shared access signature for a file or file share) for more details on how you can create a SAS on a file.

Gaurav Mantri
  • 128,066
  • 12
  • 206
  • 241
  • Thanks @gaurav-mantri, this is what I'm getting after generating shared access signature https://i.gyazo.com/2a01dd0de8726e8aa71a2fda86515692.png – Laziale Sep 27 '16 at 09:47
  • Can you please share the code for generating shared access signature? Also, tell us which SDK you're using to create them. – Gaurav Mantri Sep 27 '16 at 09:51
  • 1
    Ok, it works now, I had to increase the SharedAccessExpiryTime which was set to UTC time. For some reason though the documents which I'm uploading to azure file storage, when downloaded, I'm not able to open them, it looks like they are corrupted, although the correct size is shown. Do you have skype id for quick screenshare if possible? Thanks – Laziale Sep 27 '16 at 09:55
  • Cool! I would recommend asking a separate question for the problem you're having with uploading files. – Gaurav Mantri Sep 27 '16 at 09:57
  • http://stackoverflow.com/questions/39721926/azure-file-storage-file-is-corrupted-once-uploaded pls see if you can help me thanks @gaurav-mantri – Laziale Sep 27 '16 at 10:10
  • In your scenario, would it be possible to mount Azure Files as SMB share and access files from a drive? You can get full net use command from connect button on portal to achieve this. – Mine Tanrinian Demir - MSFT Sep 28 '16 at 01:36