Azure WebApp 到 WebApp 调用 - 我们可以将其设为私有吗?

Azure WebApp to WebApp call - Can we make it private?

我们正在部署在 .Net 核心中开发的一种微服务,并将部署在 Azure WebApp 中

这些 WebApp 之间将进行大量通信。

现在由于 WebApp 面向互联网,它们之间的所有调用都将通过互联网进行,这会对性能产生影响。

除了 ASE(App Service Enviornment),我们还有什么办法可以实现这个目标吗?

是的,您可以使用 Access Restriction:

az webapp config access-restriction add --resource-group ResourceGroup --name AppName \
   --rule-name 'IP example rule' --action Allow --ip-address 122.133.144.0/24 --priority 100

https://docs.microsoft.com/en-us/azure/app-service/app-service-ip-restrictions#adding-and-editing-access-restriction-rules-in-the-portal

ps。 AKS 可能是微服务的更好选择 ;)

有两种方法可以在两个网络应用程序之间通过私有 IP 进行通信。

  1. 在一个或两个 Web 应用程序上配置区域 VNET 集成。

  2. 考虑在第一个 Web 应用程序之前使用 Azure 应用程序网关,并配置访问限制以仅允许访问应用程序网关子网。 https://docs.microsoft.com/en-us/azure/app-service/app-service-ip-restrictions#set-a-service-endpoint-based-rule

一些其他用例

  1. 如果您不想向 Internet 公开 Web 应用程序,请使用 Service fabric。
  2. 您也可以考虑将这两个应用程序作为 API 管理的后端。 https://docs.microsoft.com/en-us/azure/api-management/api-management-using-with-internal-vnet?tabs=stv2#routing 每当您启用应用程序网关时,应用程序网关就会充当拦截器并转发流量,因此您的两个 Web 应用程序都可以通过私有 IP 进行通信。