简体   繁体   English

从 vnet 中的 Azure blob 存储访问图像

[英]Access images from Azure blob storage within vnet

We have a site which is accessible to users logged in using their Azure AD account.我们有一个站点,使用 Azure AD 帐户登录的用户可以访问该站点。 The site uses Azure blob storage to store images.该站点使用 Azure blob 存储来存储图像。 We use AccessKey to connect to the storage account and access the files within the container.我们使用 AccessKey 连接到存储帐户并访问容器内的文件。 The technology used are .Net Core and c#.使用的技术是 .Net Core 和 c#。

The IT team has asked us to bring the blob storage with VNet. IT 团队要求我们将 Blob 存储与 VNet 一起使用。 We did the change by navigating to:我们通过导航到以下位置进行了更改:

Azure portal> Storage Account>Firewalls and virtual networks>Allow access from> click 'Selected networks' option and then select virtual network and subnet. Azure 门户 > 存储帐户 > 防火墙和虚拟网络 > 允许访问 > 单击“选定网络”选项,然后选择虚拟网络和子网。

However, after the above change, the pages have stopped showing the images and we are seeing 403 errors for the images.但是,在上述更改后,页面已停止显示图像,我们看到图像出现 403 错误。 'AuthorizationFailure, This request is not authorized to perform this operation..' 'AuthorizationFailure,此请求无权执行此操作..'

While the error makes sense, I just want to know what is the best way to fix this issue.虽然错误是有道理的,但我只想知道解决此问题的最佳方法是什么。 Please note we have a lot of existing content and they hold a reference to existing images using their relative paths.请注意,我们有很多现有内容,它们使用相对路径保存对现有图像的引用。

Azure blob is a PaaS service and accessible only via public endpoints. Azure blob 是一种 PaaS 服务,只能通过公共终结点访问。 To access blob storage from your resources inside VNET you must create a private endpoint in addition to the Azure storage firewall changes you have made.若要从 VNET 内的资源访问 Blob 存储,除了所做的 Azure 存储防火墙更改之外,还必须创建一个专用终结点。 Please refer to the Azure documentation for details:有关详细信息,请参阅 Azure 文档:

https://docs.microsoft.com/en-us/azure/storage/common/storage-private-endpoints https://docs.microsoft.com/en-us/azure/storage/common/storage-private-endpoints

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM