Azure存储仅读取的斑点容器

发布于 2025-01-27 08:05:15 字数 1894 浏览 4 评论 0 原文

我正在尝试创建一个具有Azure AD身份验证的只读斑点容器。我的应用程序将将文件上传到此BLOB容器,并将电子邮件发送给我组织内的用户,并通过浏览器下载文件的链接到该文件。

我创建了一个简单的存储帐户,并在其中创建了一个斑点容器。 访问级别当前设置为:私有(无匿名访问)

,我给了我的测试用户读取器在存储帐户上 存储数据blob读取器 blob容器

给予我的Demouser帐户的许可只有读取器的Blob文件权限:

我已经用我的admin帐户上传了一个测试文件:

我的Demouser通过Azure Storage Explorer登录了我的Azure组织,我可以很好地下载文件:

“在此处输入图像说明”

但是,当我尝试使用直接链接下载文件时://sareadonly01.blob.core.windows.net/myreadonlycontainer01/testfile01.txt“ rel =” nofollow noreferrer“> https://sareadonly01.blob.core.core.core.windows.net/myread/myread/myread/myreadeononlycontainer01/testfile01/textfiledestfiledestfile01/text /strong>从浏览器中,这将是用户在电子邮件中使用链接下载这些文件的方式,我会收到此错误:“指定的资源不存在。”

如果我将blob容器的访问级别更改为:blob(匿名仅读取blobs),那么我的demuser可以在浏览器中下载文件,但是我组织外的其他所有人也可以,这也不是t使用AAD身份验证。

那么如何创建一个具有AAD身份验证的只读blob容器,并能够从浏览器中直接URL下载文件?

I am trying to create a read-only Blob Container with Azure AD Authentication. My application will upload files to this Blob container and an email will be sent to users inside my organization with a link to a file that they will download with a browser.

I have created a simple storage account and created a blob container inside it.
Access level is currently set to: Private (no anonymous access)

I have given my test user Reader permission on the Storage Account and Storage Data Blob Reader on the blob container

enter image description here

Permissions given to my demouser account that will only have Reader permissions to blob files:

enter image description here

I've uploaded a test file with my admin account:

enter image description here

With my demouser logged into my Azure Organization via Azure Storage Explorer, I can download the file just fine:

enter image description here

However when I try to download the file with a direct link https://sareadonly01.blob.core.windows.net/myreadonlycontainer01/TestFile01.txt from a browser, which will be the way the users will be downloading these files with a link in an email, I get this error: "The specified resource does not exist."

enter image description here

If I change the Access Level of the blob container to: Blob (anonymous read only access for blobs only), then my demouser can download the file in a browser, but so can everyone else outside my organization and this doesn't use AAD Authentication.

enter image description here
enter image description here

So how do I create a Read-Only Blob container with AAD Authentication and the ability to download files with a direct URL from a browser?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文