Forum Discussion
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 IlievCopper 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 IlievCopper Contributor
Thank you for pointing it out. However, it seems that this was not per the last documentation here Reset-AzVirtualNetworkGateway (Az.Network) | Microsoft Learn
I've tried this approach already and does not work as expected.
using the CLI errors with "'reset' is misspelled or not recognized by the system." - balasubramanimIron Contributor
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 IlievCopper 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.