如何为出站 IP 地址更改做准备How to prepare for an outbound IP address change

如果收到“Azure 应用服务”应用的出站 IP 地址将要更改的通知,请按照本文中的说明进行操作。If you received a notification that the outbound IP addresses of your Azure App Service app are changing, follow the instructions in this article.

确定是否需要做什么Determine if you have to do anything

  • 选项 1:如果“应用服务”应用不使用 IP 筛选、显式包含列表或出站流量的特殊处理(如路由或防火墙),则不需要执行任何操作。Option 1: If your App Service app does not use IP filtering, an explicit inclusion list, or special handling of outbound traffic such as routing or firewall, no action is required.

  • 选项 2:如果你的应用确实对出站 IP 地址进行了特殊处理(请参阅下面的示例),请在现有 IP 地址出现的任何地方添加新的出站 IP 地址。Option 2: If your app does have special handling for the outbound IP addresses (see examples below), add the new outbound IP addresses wherever the existing ones appear. 请勿替换现有的 IP 地址。Don’t replace the existing IP addresses. 按照下一部分中的说明可以找到新的出站 IP 地址。You can find the new outbound IP addresses by following the instructions in the next section.

    例如,出站 IP 地址可能显式地包含在应用之外的防火墙中,或者外部支付服务可能有一个允许列表,其中包含应用的出站 IP 地址。For example, an outbound IP address may be explicitly included in a firewall outside your app, or an external payment service may have an allowed list that contains the outbound IP address for your app. 如果出站地址在应用之外的任何位置的列表中配置,则需要更改。If your outbound address is configured in a list anywhere outside your app, that needs to change.

在 Azure 门户中找到出站 IP 地址Find the outbound IP addresses in the Azure portal

新的出站 IP 地址在生效之前会显示在门户中。The new outbound IP addresses are shown in the portal before they take effect. 当 Azure 开始使用新的出站 IP 地址时,将不再使用旧的出站 IP 地址。When Azure starts using the new ones, the old ones will no longer be used. 每次只使用一组 IP 地址,因此包含列表中的条目必须同时具有旧的和新的 IP 地址,以防止在进行切换时发生中断。Only one set at a time is used, so entries in inclusion lists must have both old and new IP addresses to prevent an outage when the switch happens.

  1. 打开 Azure 门户Open the Azure portal.

  2. 在左侧导航菜单中选择“应用服务”。 In the left-hand navigation menu, select App Services.

  3. 从列表中选择自己的应用服务应用。Select your App Service app from the list.

  4. 如果应用是一个函数应用,请参阅函数应用出站 IP 地址If the app is a function app, see Function app outbound IP addresses.

  5. 在“设置” 标题下,单击左侧导航栏中的“属性” ,找到标有“出站 IP 地址” 的部分。Under the Settings header, click Properties in the left navigation, and find the section labeled Outbound IP addresses.

  6. 复制 IP 地址,并将其添加到对出站流量的特殊处理中,例如筛选器或允许列表。Copy the IP addresses, and add them to your special handling of outbound traffic such as a filter or allowed list. 请勿删除列表中的现有 IP 地址。Don't delete the existing IP addresses in the list.

后续步骤Next steps

本文介绍了如何对 Azure 发起的 IP 地址更改做好准备。This article explained how to prepare for an IP address change that was initiated by Azure. 有关 Azure 应用服务中的 IP 地址的详细信息,请参阅 Azure 应用服务中的入站和出站 IP 地址For more information about IP addresses in Azure App Service, see Inbound and outbound IP addresses in Azure App Service.