Is it Possible to get SasToken for only a Directory in file share to download all files including sub directory's files in C#?

Sumana Haldar 21 Reputation points
2020-06-08T18:25:08.12+00:00

Can I get a sasToken for a directory in File Share in Azure File Storage using REST API using C# to download all files of that directory including sub directories but that sastoken will not be valid for other directories in the same File Share. There are official documents available but I got confused that it is possible to do that by using rest api or not. So, if some one could tell me that's possible or not then it will be very helpful.

Azure Files
Azure Files
An Azure service that offers file shares in the cloud.
1,170 questions
Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
2,717 questions
0 comments No comments
{count} votes

Accepted answer
  1. Sumarigo-MSFT 43,801 Reputation points Microsoft Employee
    2020-06-11T04:31:47.493+00:00

    @Sumana Haldar Firstly, apologies for the delay in responding here and any inconvenience this issue may have caused.

    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.

    Hope this helps!

    Kindly let us know if the above helps or you need further assistance on this issue.

    ------------------------------------------------------------------------------------------------------------------------

    Please do not forget to "Accept the answer" wherever the information provided helps you to help others in the community.

    0 comments No comments

0 additional answers

Sort by: Most helpful