Azure App Service 到 App Service 的通信通过专用 Link
Azure App Service to App Service communication via Private Link
我有一个包含两个应用服务的 Azure 应用。应用服务 A 在应用服务 B 上调用 API。
我想使用私有 Link 来确保它们之间的流量是私有的,而不是通过 public IP。所以这就是我所做的:
创建了一个新的 VNet
已配置从两个应用服务到新 VNet 的专用终结点,并带有专用 DNS 集成
确保已创建专用 DNS,链接到新的 VNet,并且两个服务都已在其中注册。
确保这两个服务都无法访问publicly(我得到 403)
用于测试:在 VNet 中创建了一个新的 VM,并确保我可以从 VM 浏览到服务。工作正常。我使用他们原来的 URL 浏览服务: serviceX.azurewebsites.net.
但是 - 当我尝试从服务 A 调用服务 B(使用相同的 URL - serviceb.azurewebsites.net)时,我得到 403(禁止访问)。
我错过了什么?
如何让两个应用程序服务通过专用 Link 连接到同一个 VNet?
在这种情况下,您可能需要 integrate your app with an Azure virtual network 并且集成子网需要同一 VNet 中未使用的子网。
来自 Using Private Endpoints for Azure Web App,
Private Endpoint is only used for incoming flows to your Web App. Outgoing flows will not use this Private Endpoint, but you can inject
outgoing flows to your network in a different subnet through the VNet
integration feature.
另外,请注意
If you route all of your outbound traffic into your VNet, it's subject
to the NSGs and UDRs that are applied to your integration subnet. When
you route all of your outbound traffic into your VNet, your outbound
addresses are still the outbound addresses that are listed in your app
properties unless you provide routes to send the traffic elsewhere.
此外,如果您在应用程序设置中将 WEBSITE_VNET_ROUTE_ALL
设置为 1
,您的所有出站呼叫都会受到影响,并且如果您想让您的应用程序使用 Azure DNS 私有区域,您应该将 WEBSITE_DNS_SERVER
设置为 168.63.129.16
.
我有一个包含两个应用服务的 Azure 应用。应用服务 A 在应用服务 B 上调用 API。
我想使用私有 Link 来确保它们之间的流量是私有的,而不是通过 public IP。所以这就是我所做的:
创建了一个新的 VNet
已配置从两个应用服务到新 VNet 的专用终结点,并带有专用 DNS 集成
确保已创建专用 DNS,链接到新的 VNet,并且两个服务都已在其中注册。
确保这两个服务都无法访问publicly(我得到 403)
用于测试:在 VNet 中创建了一个新的 VM,并确保我可以从 VM 浏览到服务。工作正常。我使用他们原来的 URL 浏览服务: serviceX.azurewebsites.net.
但是 - 当我尝试从服务 A 调用服务 B(使用相同的 URL - serviceb.azurewebsites.net)时,我得到 403(禁止访问)。
我错过了什么?
如何让两个应用程序服务通过专用 Link 连接到同一个 VNet?
在这种情况下,您可能需要 integrate your app with an Azure virtual network 并且集成子网需要同一 VNet 中未使用的子网。
来自 Using Private Endpoints for Azure Web App,
Private Endpoint is only used for incoming flows to your Web App. Outgoing flows will not use this Private Endpoint, but you can inject outgoing flows to your network in a different subnet through the VNet integration feature.
另外,请注意
If you route all of your outbound traffic into your VNet, it's subject to the NSGs and UDRs that are applied to your integration subnet. When you route all of your outbound traffic into your VNet, your outbound addresses are still the outbound addresses that are listed in your app properties unless you provide routes to send the traffic elsewhere.
此外,如果您在应用程序设置中将 WEBSITE_VNET_ROUTE_ALL
设置为 1
,您的所有出站呼叫都会受到影响,并且如果您想让您的应用程序使用 Azure DNS 私有区域,您应该将 WEBSITE_DNS_SERVER
设置为 168.63.129.16
.