我正在尝试创建一个具有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

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

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

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

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."

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.


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?
发布评论