是否可以在azure blob存储中为给定目录生成具有写许可权的SAS(共享访问签名) [英] Is it possible to generate SAS (Shared Access Signature) with write permission for given directory in azure blob storage

查看:83
本文介绍了是否可以在azure blob存储中为给定目录生成具有写许可权的SAS(共享访问签名)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的Blob存储帐户结构:

Our blob storage account structure:

容器名称:简单

在此容器内,我们有斑点:

inside this container we have blobs:

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

是否可以生成对一个目录"具有写许可权但对bb目录"没有访问权的SAS?

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

使用Amazon AWS,我们可以轻松地基于对象/blob前缀名称创建限制,但是在Azure Storage sdk for Java中找不到类似的功能.

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.

推荐答案

到目前为止,在文件夹级别上无法这样做,因为这样Azure Blob存储中没有文件夹.

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.

您可以在容器级别或Blob级别创建SAS.如果您希望用户仅上传具有特定名称的文件,则可以很好地创建对blob名称具有写许可权的SAS.创建SAS时,无需显示Blob.

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.

因此,当您的用户使用此SAS上传文件时,该文件将另存为您选择命名的Blob.因此,您要做的就是为名为 bb/ss.zip 的Blob创建一个SAS,并将其提供给用户.当用户上传文件时,该文件将另存为 bb/ss.zip 在您的Blob容器中.

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.

这篇关于是否可以在azure blob存储中为给定目录生成具有写许可权的SAS(共享访问签名)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆