Azure 前门托管识别读取存储 Blob - 授权错误

标签 azure azure-storage azure-managed-identity azure-front-door

我正在尝试在 Azure 前门使用托管标识来访问(读取)Azure 存储 Blob。作为先决条件,我将“存储 Blob 数据读取器”RBAC 分配给存储帐户 IAM 中的托管身份,但我始终收到授权错误。 Front Door 似乎正在以匿名身份发送请求!

我的期望是,由于使用了托管身份,因此我不必在请求中传递授权 header 。我可以使用前门的托管身份连接到 Azure Key Vault,但同样不适用于存储帐户!

存储帐户没有网络限制。它被设置为从所有网络启用(出于 POC 目的)。

为了测试,我将 Blob 访问级别设置为 Blob(匿名访问),并且我能够使用前门端点读取该 Blob,但出于安全原因,我无法公开该 Blob。

有什么建议如何安全地从 Azure Front Door 访问私有(private) blob?

最佳答案

I made the blob access level to Blob (anonymous access) and I was able to read the blob using front door endpoint, but I can't make the blob public for security reason.

请注意,托管身份尚未在 AFD 和存储之间集成。 AFD Premium 支持 Private Link,可用于私密访问存储。

要使用前门托管标识连接到 Azure Key Vault,您可以使用此 MsDoc

使用创建的 Azure 前门高级版,创建私有(private)链接服务和 WAF 策略,然后选择自定义源类型并启用私有(private)链接服务,如下所示:

enter image description here

enter image description here

在 Azure 存储帐户中创建专用终结点以安全访问,并从 Azure Front Door Premium 选择待处理的专用终结点请求,然后选择“批准”,如下所示:

enter image description here

enter image description here

使用主机名存储帐户 blob 创建的 Azure 前门将安全地访问私有(private) blob:

enter image description here

引用文献:

Connect Azure Front Door Premium to a storage account origin with Private Link - Azure Private Link | Microsoft Learn

Secure your Origin with Private Link in Azure Front Door Premium | Microsoft Learn

关于Azure 前门托管识别读取存储 Blob - 授权错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/76663262/

相关文章:

c# - C# 中的 Azure 托管服务标识连接到 Azure SQL Server

azure - 如何在Visual Studio Code中使用MSI进行开发?

caching - Azure 网站的临时存储

java - 将 jar 可执行文件上传到 Azure 并运行

linux - 如何获取安全扫描后受影响的azure容器镜像列表?

azure - 使用存储在 Blob 上创建的(通用/系统准备的)快照在 Azure 上部署 VM

azure - 逻辑应用在 Blob 上传时触发两次

azure - 删除数据流中日期范围内的数据

c# - Azure Web 作业 : Can't bind Queue to type 'System.String'

c# - 使用托管身份在另一个函数应用程序中调用 http 触发的函数应用程序