使用Azure函数(APP)的私有端点和VNET集成访问Azure存储帐户

发布于 2025-02-08 02:50:01 字数 157 浏览 2 评论 0原文

好的,这是为了节省其他人4天的工作。

试图使用VNET集成将美国中部中部地区的Azure功能连接到美国西部地区的存储帐户。美国西部地区的存储帐户启用了防火墙。我发布此信息的唯一原因是,我们的员工通常会为具有IP地址的虚拟机设置为可以添加到存储帐户防火墙而不是应用程序服务计划中的虚拟机。

Ok this is to save someone else 4 days of work.

Trying to use VNet integration to connect an Azure Function in the North Central US region to a storage account in the US West region. The storage account in the US West region has the firewall enabled. The only reason I am posting this is our staff normally sets this up for virtual machines which have an IP address that can be added into the storage account firewall and not app service plans.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

岁吢 2025-02-15 02:50:01

如果您想在私人端点后面确保Azure存储空间,并且希望服务计划(即Azure功能或Web应用程序)访问该存储帐户。

禁用存储帐户防火墙时。
包含存储帐户端点(应用程序服务的子网中)的同一VNET中的应用程序服务有效。因此,进一步澄清。您将拥有带有默认子网,a storege 子网和 app 子网的VNET。存储帐户防火墙已关闭。然后,Web应用程序可以访问您在存储子网中设置的端点。

启用存储帐户防火墙时。

  • 如果您打算使用VNET对等(非常简单)。 VNET需要在同一区域(即我们的东部)或在区域对中,例如(美国东/美国西部),
  • 您必须设置VNET对等。
  • 您必须将应用程序服务使用的子网添加到存储帐户防火墙中。

此外,不在同一区域或区域对内的子网也不会显示在存储帐户防火墙中供您添加。

可以选择尝试预览功能allowglobaltagsforstorage,但我不能在生产环境中使用它。

因此,要澄清这一点:

  • 您的vnet useastVnet default 存储
  • 您的存储帐户在存储中具有私有端点子网
  • 启用了存储帐户防火墙。
  • 您有另一个带子网的vnet uswestvnet
    default apps
  • useastvnet uswestvnet
  • 您已添加了Subnet apps 进入存储帐户防火墙。
  • 使用此设置,您可以使用VNET集成到 app 子网中使用Web应用程序或Azure函数。

您可以简单地使用“存储帐户连接”字符串,只要您拥有所需的端点设置,所有内容就可以正常工作。

因此,我的解决方案是将我的设置移至美国西部地区。

If you want to secure your azure storage behind a private endpoint and you want a service plan (I.E. Azure Function or Web App) to access said storage account.

When the storage account firewall is disabled.
An App service in the same Vnet containing the storage account endpoints (within a subnet for the app service) works. So to further clarify. You would have a Vnet with the default subnet, a storage subnet, and a app subnet. The storage account firewall is off. Then the web app can access the endpoints that you setup in the storage subnet.

When the storage account firewall is enabled.

  • If you intend to use Vnet peering (very easy). The VNets need to be in the same region (I.E. US East) or within a region pair like (US East/US West)
  • You must setup Vnet peering.
  • You must add the subnet used by the app service into the storage account firewall.

Also a subnet that is not within the same region or a region pair will not show up in the storage account firewall for you to add it.

There is the option to try a preview feature AllowGlobaltagsForStorage but I cannot use that within a production environment.

So to clarify this:

  • You have Vnet useastvnet with subnets default, storage
  • Your storage account has private endpoints into the storage subnet
  • The storage account firewall is enabled.
  • You have another Vnet uswestvnet with subnets
    default, apps
  • You have useastvnet peered with uswestvnet
  • You have the subnet apps added into the storage account firewall.
  • You have your web app or Azure Function using vnet integration into the app subnet

With this setup you can simply use the storage account connect string and everything should work as long as you have the endpoints setup that you need.

So my fix was to move my setup to the US West region.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文