3

How can I get a Sas url with read-only or write-only permission for a directory in Azure File Share to access all files and sub directory in that directory but it will not be accessible by other directory o files in Azure File Share?

Is there any way to create the sasToken by using the REST API or client libraries for a Directory in c#? In Microsoft Document (https://learn.microsoft.com/en-us/azure/storage/files/storage-files-faq) they said it's possible to create a shared access signature by using the REST API or client libraries, by specifying read-only or write-only permissions on folders within the share.

Any Suggestion how this works?

Tom
  • 47,574
  • 2
  • 16
  • 29
Sumana
  • 51
  • 1
  • 6

2 Answers2

4

How can I get a Sas url with read-only or write-only permission for a directory in Azure File Share to access all files and sub directory in that directory but it will not be accessible by other directory o files in Azure File Share?

It is not possible to create a SAS token to restrict access to a directory only. You can either create a SAS token for an entire share or a file but not for a directory.

Gaurav Mantri
  • 128,066
  • 12
  • 206
  • 241
0

Directory scoped SAS is now supported for file shares and blobs, see this for more details.

LiorAbadi
  • 19
  • 4
  • I just stumbled upon this answer. Directly level SAS is still not supported for File Shares. It is only supported for Blob Storage which has Hierarchical Namespace enabled. Thought I would bring this to your attention. – Gaurav Mantri Jun 22 '21 at 14:10