How to disconnect virtual network gateway connection

Subir Saha 0 Reputation points
2023-04-11T15:31:30.58+00:00

Hello, I am trying to disconnect virtual network gateway connection but getting below error: Vpn client addresspool is not specified for gateway Command i am using is below: Disconnect-AzVirtualNetworkGatewayVpnConnection -ResourceName xyz -ResourceGroupName abc -VpnConnectionId @("rgh89f-ddfr-abcg-951e-1ed145c688cd") I am not sure if i am putting the right VPn connection ID (please let me know if there is a way to get the connection id) Again i am only trying to disconnect and not delete the vpn connection.

Azure VPN Gateway
Azure VPN Gateway
An Azure service that enables the connection of on-premises networks to Azure through site-to-site virtual private networks.
1,712 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. ChaitanyaNaykodi-MSFT 27,366 Reputation points Microsoft Employee
    2023-04-12T04:16:21.8933333+00:00

    @Subir Saha Thank you for reaching out to us. You can fetch the VpnConnectionId by running the command mentioned here

    Get-AzVirtualNetworkGatewayVpnClientConnectionHealth -VirtualNetworkGatewayName <name of the gateway>  -ResourceGroupName <name of the resource group>
    

    Copy the VpnConnectionId of the session that you want to disconnect.

    Disconnect-AzVirtualNetworkGatewayVpnConnection -VirtualNetworkGatewayName <name of the gateway> -ResourceGroupName <name of the resource group> -VpnConnectionId <VpnConnectionId of the session>
    
    

    You can try this via Portal if PowerShell command fails. Hope this helps! Please let me know if you are still facing the same issue. Thank you!


  2. Hakim 0 Reputation points
    2023-08-23T20:43:44.6966667+00:00

    Hello,

    Same issue as Subir Saha with the message

    "Vpn Client operation cannot be performed without a valid VpnClientConfiguration."

    Please share the your solution here

    Thanks!

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.