无法删除虚拟网络

Unable to delete Virtual Network

我使用 Powershell 创建了一个虚拟网络(经典)。网络网关也已创建,但现在我无法删除虚拟网络。当我 运行: Remove-AzureVNetGateway -VNetName '<vnet>' 时,显示以下输出:

Remove-AzureVNetGateway : ConflictError: The current provisioning status of the gateway prevents this operation.
At line:1 char:1
+ Remove-AzureVNetGateway -VNetName '<vnet>'
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [Remove-AzureVNetGateway], CloudException
    + FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Gateway.RemoveAzureVNetGateway

好像还在配置网关,但是我已经一个多小时没有配置网关了。当我 运行 get-azurevnetgateway -VNetName '<vnetname>' 时,我得到以下输出:

LastEventData        :
LastEventTimeStamp   : 07-11-16 23:30:40
LastEventMessage     : Successfully deleted the gateway for the following virtual network: GatewayManager_f63ad77a-a35c-4e19-ace5-8acaadddefae
LastEventID          : 23004
State                : NotProvisioned
VIPAddress           :
DefaultSite          :
GatewaySKU           : Default
OperationDescription : Get-AzureVNetGateway
OperationId          : b3f474b9-7468-331a-a8df-6c9b4de548e3
OperationStatus      : Succeeded

有人知道 GatewayManager_f63ad77a-a35c-4e19-ace5-8acaadddefae 是什么吗?它是我在尝试删除虚拟网络之前删除的网关吗?

这是我的 'configure' 选项卡在这个虚拟网络中的样子:

缺少 'site-to-site connectivity'。当我尝试重命名网关子网时,显示以下消息:Cannot delete or modify subnet while in use 'GatewaySubnet'.

我不确定是什么让您相信网关仍然存在。根据第二张截图,网关已经被移除,状态为"NotProvisioned".

我已经在我的实验室中对此进行了测试。这是我部署网关之前 get-azurevnetgateway 的输出:

部署成功后的结果如下:

最后一张截图是删除网关后的截图:

如果要删除仪表板上网关的图形,只需取消选中以下复选框并保存 VNET 的设置即可。

终于找到了。当我使用 运行 Get-AzureVirtualNetworkGateway 命令时,它会列出订阅中的所有网络网关。尽管 Get-AzureVNetGateway 没有显示任何内容,但 Get-AzureVirtualNetworkGateway 确实显示了一个网关:

GatewayId            : a9732eae-8670-4c25-9420-30708915c8e1 
GatewayName          : VpnGateway                           
LastEventData        :                                      
GatewayType          : DynamicRouting                       
LastEventTimeStamp   : 07-11-16 23:42:53                    
LastEventMessage     : Successfully configured the gateway. 
LastEventID          : 23005                                
State                : Provisioned                          
VIPAddress           : 52.187.46.131                        
DefaultSite          :                                      
GatewaySKU           : Default                              
Location             : Southeast Asia                       
VnetId               : f63ad77a-a35c-4e19-ace5-8acaadddefae 
SubnetId             :                                      
EnableBgp            : False                                
Asn                  : 65515                                
BgpPeeringAddress    : 10.102.100.254                       
PeerWeight           : 0                                    
OperationDescription :                                      
OperationId          :                                      
OperationStatus      :                                      

可以使用 Remove-AzureVirtualNetworkGateway -GatewayId a9732eae-8670-4c25-9420-30708915c8e1 删除此网关(需要相当长的时间),然后删除虚拟网络。

感谢 Ming Pun 在 Microsoft Forum 上回答了类似的问题。