使用门户删除虚拟网络网关Delete a virtual network gateway using the portal

本文提供了有关删除使用资源管理器部署模型部署的 Azure VPN 网关的说明。This article provides the instructions for deleting an Azure VPN gateways deployed using the Resource Manager deployment model. 可以使用多种不同的方法来删除 VPN 网关配置中的虚拟网络网关。There are a couple of different approaches you can take when you want to delete a virtual network gateway for a VPN gateway configuration.

  • 如果要删除所有信息并从头开始配置(例如,在测试环境中),可以删除资源组。If you want to delete everything and start over, as in the case of a test environment, you can delete the resource group. 删除某个资源组时,会删除该组中的所有资源。When you delete a resource group, it deletes all the resources within the group. 仅在不想保留资源组中的任何资源时,才建议使用此方法。This method is only recommended if you don't want to keep any of the resources in the resource group. 使用这种方法时,无法做到有选择性地删除一部分资源。You can't selectively delete only a few resources using this approach.

  • 如果想要保留资源组中的某些资源,则删除虚拟网络网关的过程会略微复杂一些。If you want to keep some of the resources in your resource group, deleting a virtual network gateway becomes slightly more complicated. 在删除虚拟网络网关之前,必须先删除任何依赖于该网关的资源。Before you can delete the virtual network gateway, you must first delete any resources that are dependent on the gateway. 遵循的步骤取决于创建的连接类型,以及每个连接的依赖资源。The steps you follow depend on the type of connections that you created and the dependent resources for each connection.

Important

下面的说明介绍如何删除使用资源管理器部署模型部署的 Azure VPN 网关。The instructions below describe how to delete Azure VPN gateways deployed using the Resource Manager deployment model. 若要删除使用经典部署模型部署的 VPN 网关,请使用此处所述的 Azure PowerShell。To delete a VPN gateway deployed using the classic deployment model, please use Azure PowerShell as described here.

删除 VPN 网关Delete a VPN gateway

若要删除虚拟网络网关,必须先删除与该虚拟网络网关相关的每个资源。To delete a virtual network gateway, you must first delete each resource that pertains to the virtual network gateway. 由于存在依赖关系,必须按特定的顺序删除资源。Resources must be deleted in a certain order due to dependencies.

步骤 1:导航到虚拟网络网关Step 1: Navigate to the virtual network gateway

  1. Azure 门户中导航到“所有资源”。 In the Azure portal, navigate to All resources.
  2. 若要打开“虚拟网关”页,请导航到要删除的虚拟网关,然后单击它。To open the virtual network gateway page, navigate to the virtual network gateway that you want to delete and click it.

步骤 2:删除连接Step 2: Delete connections

  1. 在“虚拟网络网关”页中,单击“连接”以查看连接到该网关的所有连接 。On the page for your virtual network gateway, click Connections to view all connections to the gateway.
  2. 在连接名称所在的行中,单击“...” ,并从下拉列表中选择“删除” 。Click the '...' on the row of the name of the connection, then select Delete from the dropdown.
  3. 单击“是” 以确认要删除该连接。Click Yes to confirm that you want to delete the connection. 如有多个连接,请删除每个连接。If you have multiple connections, delete each connection.

步骤 3:删除虚拟网络网关Step 3: Delete the virtual network gateway

请注意,除了 S2S 配置,如果还有此 VNet 的 P2S 配置,则删除虚拟网关将自动断开所有 P2S 客户端且不发出警告。Be aware that if you have a P2S configuration to this VNet in addition to your S2S configuration, deleting the virtual network gateway will automatically disconnect all P2S clients without warning.

  1. 在“虚拟网关”页中,单击“概览” 。On the virtual network gateway page, click Overview.
  2. 在“概述”页上,单击“删除”以删除网关 。On the Overview page, click Delete to delete the gateway.

此时,虚拟网络网关已删除。At this point, the virtual network gateway is deleted. 接下来的步骤将帮助你删除不再使用的任何资源。The next steps help you delete any resources that are no longer being used.

删除本地网络网关To delete the local network gateway

  1. 在“所有资源” 中,找到与每个连接相关联的本地网络网关。In All resources, locate the local network gateways that were associated with each connection.
  2. 在本地网络网关的“概述” 边栏选项卡上,单击“删除” 。On the Overview blade for the local network gateway, click Delete.

删除网关的公共 IP 地址资源To delete the Public IP address resource for the gateway

  1. 在“所有资源” 中,找到已分配给网关的公共 IP 地址资源。In All resources, locate the Public IP address resource that was associated to the gateway. 如果虚拟网络网关采用主动-主动配置,会显示两个公共 IP 地址。If the virtual network gateway was active-active, you will see two Public IP addresses.
  2. 在公共 IP 地址的“概述” 页上,单击“删除” ,并单击“是” 进行确认。On the Overview page for the Public IP address, click Delete, then Yes to confirm.

删除网关子网To delete the gateway subnet

  1. 在“所有资源” 中,找到虚拟网络。In All resources, locate the virtual network.
  2. 在“子网” 边栏选项卡上,单击“GatewaySubnet” ,并单击“删除” 。On the Subnets blade, click the GatewaySubnet, then click Delete.
  3. 单击“是” 确认要删除该网关子网。Click Yes to confirm that you want to delete the gateway subnet.

通过删除资源组来删除 VPN 网关Delete a VPN gateway by deleting the resource group

如果不关心是否要保留资源组中的任何资源,而只是要从头开始配置,则可以删除整个资源组。If you are not concerned about keeping any of your resources in the resource group and you just want to start over, you can delete an entire resource group. 这种方法可以快速删除所有信息。This is a quick way to remove everything. 以下步骤仅适用于 Resource Manager 部署模型。The following steps apply only to the Resource Manager deployment model.

  1. 在“所有资源” 中,找到该资源组并单击以打开边栏选项卡。In All resources, locate the resource group and click to open the blade.
  2. 单击 “删除”Click Delete. 在“删除”边栏选项卡上,查看受影响的资源。On the Delete blade, view the affected resources. 请确保要删除所有这些资源。Make sure that you want to delete all of these resources. 否则使用本文开头“删除 VPN 网关”中的步骤。If not, use the steps in Delete a VPN gateway at the top of this article.
  3. 要继续,请键入要删除的资源组的名称,并单击“删除” 。To proceed, type the name of the resource group that you want to delete, then click Delete.