Is it possible to generate SAS (Shared Access Signature) with write permission for given directory in azure blob storage

梦想与她 提交于 2021-02-08 05:16:35

问题


Our blob storage account structure:

container name: simple

inside this container we have blobs:

aa/one.zip
aa/two.zip
bb/ss.zip
bb/dd.zip

Is it possible to generate SAS with write permission for aa “directory”, but no access for bb “directory”?

With Amazon AWS we can easily create restrictions based on object/blob prefix name, but I can't find similar functionality in azure storage sdk for java.


回答1:


As of today, it is not possible to do so at the folder level because as such there's no folder in Azure Blob Storage.

You can either create a SAS at a container level or at the blob level. If you want your users to only upload files with certain names, you can very well create a SAS with write permission on the blob name. Blob need not be present when you're creating a SAS.

Thus when your users upload a file using this SAS, it will be saved as a blob that you have chosen to name. So what you will do is create a SAS for a blob named bb/ss.zip and give it to a user. When the user uploads the file, it will be saved as bb/ss.zip in your blob container.



来源:https://stackoverflow.com/questions/37270955/is-it-possible-to-generate-sas-shared-access-signature-with-write-permission-f

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!