简体   繁体   English

如何将流量从我的Azure应用服务路由到特定的外部IP地址

[英]How to route traffic from my Azure App Service to specific external IP address

I'm trying to follow along with the guide found here: https://docs.microsoft.com/en-us/azure/app-service-web/web-sites-integrate-with-vnet 我正在尝试遵循此处找到的指南: https : //docs.microsoft.com/zh-cn/azure/app-service-web/web-sites-integrate-with-vnet

I have tried both connecting to an existing VNET and setting up a new VNET, but the results are the same. 我尝试连接到现有的VNET和设置新的VNET,但是结果是相同的。

I have an existing VNET that connects to an external partner service. 我有一个连接到外部合作伙伴服务的现有VNET。 When I connect a VM to the VNET, I am able to telnet into the external partner's IP:port. 将VM连接到VNET时,我可以通过telnet进入外部合作伙伴的IP:端口。 When I connect the azure app service to that same VNET, I am unable to get the traffic to route to that external partner service. 当我将Azure应用程序服务连接到同一VNET时,我无法获得流量以路由到该外部合作伙伴服务。

From the guide, it looks like I should be able to just add IP address range to the App Service Plan's Networking configuration as seen in this image from the linked article. 从该指南看来,我应该能够将IP地址范围添加到App Service Plan的网络配置中,如链接文章中的此图所示。

路由到VNET的IP地址包括文本框

When I go into my App Service Plan's Networking configuration, I have no option to add more IP addresses. 当我进入App Service Plan的网络配置时,没有选择添加更多IP地址的选项。

我的应用服务计划的网络配置

When I look at the App Service directly (not the plan), I see that there are some default routes (not sure where those come from). 当我直接查看App Service(不是计划)时,我看到有一些默认路由(不确定这些路由来自何处)。

App Service Plan网络配置

I tried adding a User Defined Route to the route table associated with the subnet, but that did not appear in the IP Addresses Routed To VNET. 我尝试将用户定义的路由添加到与子网关联的路由表中,但未显示在“路由到VNET的IP地址”中。

The address range listed in the Site-to-Site address space is the range that I need forwarded. 站点到站点地址空间中列出的地址范围是我需要转发的范围。

So, while the article shows that you can add routes via the portal seen in the first image of the question, that functionality does not exist. 因此,尽管文章显示您可以通过问题的第一张图片中所示的门户添加路线,但该功能不存在。 To add a route, you have to use the resource explorer and edit the service plan. 要添加路线,您必须使用资源浏览器并编辑服务计划。

资源浏览器

From here, it will open the explorer to the app service plan selected. 从这里,它将打开资源管理器以打开所选的应用程序服务计划。 Find the virtualNetworkConnections node and open it. 找到virtualNetworkConnections节点并打开它。 Inside you'll see a Routes node. 在内部,您将看到一个Routes节点。 Pick routes. 选择路线。

虚拟网络连接

Enable Read/Write capability in the top bar. 在顶部栏中启用读取/写入功能。

启用读/写

Copy an existing route from the list if there is one to pick up the default values, then pick create option to add a new route. 从列表中复制现有路由(如果有)来选择默认值,然后选择“创建”选项以添加新路由。

建立路线

Paste the existing route and update appropriate fields or fill in from scratch. 粘贴现有路线并更新相应的字段,或从头开始填写。 Here is an example... 这是一个例子

{
  "id": "/subscriptions/<subid>/resourceGroups/<RG name>/providers/Microsoft.Web/serverFarms/<service plan name>/virtualNetworkConnections/<vnet name>/routes/<route name>",
  "name": "<route name>",
  "type": "Microsoft.Web/serverfarms/virtualNetworkConnections/routes",
  "location": "<location, eg East US 2>",
  "properties": {
    "name": "<route name>",
    "startAddress": "<start address>",
    "endAddress": "<end address>",
    "routeType": "DEFAULT",
    "denyRoute": false
  }
}

If you had an existing route, you should only need to change the <route name> , <start address> , and <end address> . 如果您已有一条路由,则只需更改<route name><start address><end address>

The {Resource Name} field should be populated with same value as in the template. {Resource Name}字段应填充与模板中相同的值。 After filled in, select PUT. 填写后,选择PUT。 The new route will now be available. 新路线现已可用。

放置路线

To add a route. 添加路线。 It needs to be done at the App Service Plan level. 它需要在应用服务计划级别完成。

"The only operation you can take in the app view of your VNet Integration is to disconnect your app from the VNet it is currently connected to. To disconnect your app from a VNet, select Disconnect. Your app will be restarted when you disconnect from a VNet. Disconnecting doesn't change your VNet. The VNet and its configuration including the gateways remains unchanged. If you then want to delete your VNet, you need to first delete the resources in it including the gateways. “在VNet集成的应用程序视图中,唯一可以执行的操作是将应用程序与当前连接的VNet断开连接。要从VNet断开应用程序的连接,请选择Disconnect。当您从VNet Integration断开连接时,应用程序将重新启动。 VNet。断开连接不会更改您的VNet。VNet及其配置(包括网关)保持不变。如果要删除VNet,则需要先删除其中的资源(包括网关)。

To reach the ASP VNet Integration UI, open your ASP UI and select Networking. 要访问ASP VNet集成UI,请打开ASP UI并选择“网络”。 Under VNet Integration, select Click here to configure to open the Network Feature Status UI." 在“ VNet集成”下,选择“单击此处进行配置以打开网络功能状态UI”。”

"The ASP VNet Integration UI will show you all of the VNets that are used by the apps in your ASP. You can have up to 5 VNets connected to by any number of apps in your App Service plan. Each app can have only one integration configured. To see details on each VNet, click on the VNet you are interested in. There are two actions you can perform here. “ ASP VNet集成UI会向您显示ASP中的应用所使用的所有VNet。在您的App Service计划中,您可以通过任意数量的应用最多连接5个VNet。每个应用只能有一个集成要查看每个VNet的详细信息,请单击您感兴趣的VNet。您可以在此处执行两个操作。

Sync network. 同步网络。 The sync network operation makes sure that your certificates and network information are in sync. 同步网络操作可确保您的证书和网络信息同步。 If you add or change the DNS of your VNet, you need to perform a Sync network operation. 如果添加或更改VNet的DNS,则需要执行同步网络操作。 This operation will restart any apps using this VNet. 此操作将重新启动使用此VNet的所有应用程序。 Add routes Adding routes will drive outbound traffic into your VNet. 添加路由添加路由会将出站流量驱动到您的VNet。 Routing The routes that are defined in your VNet are used to direct traffic into your VNet from your app. 路由VNet中定义的路由用于将流量从应用程序引导到VNet。 If you need to send additional outbound traffic into the VNet, then you can add those address blocks here." 如果需要将其他出站流量发送到VNet,则可以在此处添加这些地址块。”

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

相关问题 如何将来自与包含服务终结点的 VNet 集成的应用服务的出站流量路由到外部 Azure 托管 API? - How can I route outbound traffic from an App Service integrated with a VNet containing a Service Endpoint to an external Azure hosted API? Azure Traffic Manager-按用户IP地址路由 - Azure Traffic manager - Route by User IP Address 如何将Azure终结点(DNS /静态IP)上托管的流量重定向到其他外部IP地址 - How to redirect traffic hosted on an azure endpoint (DNS/static IP) to different external IP address 如何查找访问我使用 Azure 应用服务部署的 Web 应用程序的用户的 IP 地址? - How to find the IP address of the user who accessed my web application deployed using Azure App Service? 如何在 Azure Web 应用服务上获取 IP 地址 - How to get IP Address on Azure Web App Service Azure 应用服务 - 如何将端点列入白名单(不是 IP 地址) - Azure app service - how do I whitelist an endpoint (not IP address) 如何允许特定的IP地址访问Azure中部署的Web应用程序? - How to allow specific ip address to access my webapp deployed in azure? 更改Azure App服务的IP地址 - Change IP address of azure app service 使用IP地址而非主机名访问Azure App Service - Access azure app service with ip address not the hostname 禁用Azure IP Service的外部IP - Disable external IP for Azure App Service
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM