Forum Discussion

Kiril Iliev's avatar
Kiril Iliev
Copper Contributor
Jan 29, 2025

Azure CLI - reset VPN Connection

I am looking for a way to reset a VPN connection with Azure CLI. There was no information about stopping and starting the service.

Is there a way to do that from PowerShell CMD?

az network vpn-connection

5 Replies

  • Kiril Iliev's avatar
    Kiril Iliev
    Copper Contributor

    Reset-AzVirtualNetworkGateway - only resets the network gateway

    az network vpn-connection reset - errors with 'reset' is misspelled or not recognized by the system. Also this is not listed in the documentation. Is this some kind of extension?

  • Kiril Iliev 

    You can reset an Azure VPN connection using Azure CLI with the following command:

    Reset VPN Connection
    az network vpn-connection reset --resource-group <ResourceGroup> --name <VPNConnectionName>

    Restart VPN Gateway (if needed)
    If the issue persists, restart the VPN Gateway:
    az network vnet-gateway reset --resource-group <ResourceGroup> --name <VPNGatewayName>

    PowerShell Alternative
    If using PowerShell, run:
    Reset-AzVirtualNetworkGateway -ResourceGroupName "<ResourceGroup>" -Name "<VPNGatewayName>"

    These commands reset the connection without deleting it.

     

  • Kiril Iliev's avatar
    Kiril Iliev
    Copper Contributor

    Thank you for sharing, but these commands do not provide a solution for resetting the tunnel.

    For now I am resetting the local end point and the virtual end point, but I'd rather see a solution to do it in a single command as in the interface.

Resources