Frank Q.
Frank Q.

Reputation: 6592

SAS for CloudBlobDirectory or path within a container

Is there a way to generate a SAS token or policy for a virtual path within blob container ?

E.g. I have a blob container called mycontainer. Inside it have the following blobs

FolderA/PathA/file.pdf

FolderA/PathA/file2.mpg

FolderA/PathC/file.doc

FolderB/PathA/file.pdf

I want to generate SAS token such that the client/application can perform operations inside of FolderA only within container mycontainer

Is that possible ?

Alternate approach is either to

a) Create a list of SAS tokens for each file (i.e. blockblob) within FolderA

b) Re-design such that FolderA is a blob container instead

Upvotes: 3

Views: 1730

Answers (1)

Gaurav Mantri
Gaurav Mantri

Reputation: 136256

I want to generate SAS token such that the client/application can perform operations inside of FolderA only within container mycontainer

Is that possible ?

No, it is not possible because Folder inside a blob container is a virtual entity. Azure blob storage supports only two level hierarchy - container and blob. A folder is simply the prefix in a blob's name.

Both of the solutions you mentioned below are good alternatives and you would be able to use either of them depending on your use case. My recommendation would be to use approach (b) as it provides a nice isolation for individual users in the sense that each user gets her/his own container where they can save their own files.

Upvotes: 3

Related Questions