This document provides a reference for PowerShell cmdlets used to manage VPN client connections to Azure Virtual Network Gateways. These cmdlets are part of the Azure PowerShell module and are essential for configuring and monitoring secure remote access to your Azure resources.
Azure Virtual Network Gateway enables secure, cross-premises connectivity between your on-premises network and your Azure Virtual Network (VNet). VPN client connections allow individual users to connect to your VNet from their devices. The following cmdlets help you manage these connections.
The primary cmdlets for managing VPN client connections include:
Get-AzVpnClientConnection
                    Retrieves information about existing VPN client connections.
New-AzVpnClientConnection
                    Creates a new VPN client connection profile.
Remove-AzVpnClientConnection
                    Removes a VPN client connection profile.
Set-AzVpnClientConnection
                    Updates settings for an existing VPN client connection profile.
Get-AzVpnClientConnectionHealth
                    Retrieves the health status of VPN client connections.
Get-AzVpnClientConnectionConfiguration
                    Retrieves the configuration details for VPN client connections.
Get-AzVpnClientConnectionThis cmdlet retrieves information about VPN client connections. You can filter results by gateway name, resource group, or connection name.
Get-AzVpnClientConnection
    [-ResourceGroupName <String>]
    [-VirtualNetworkGatewayName <String>]
    [-Name <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [ <CommonParameters> ]-ResourceGroupName: The name of the resource group for the Virtual Network Gateway.-VirtualNetworkGatewayName: The name of the Virtual Network Gateway.-Name: The name of the VPN client connection profile.Get-AzVpnClientConnection -ResourceGroupName "MyResourceGroup" -VirtualNetworkGatewayName "MyVpnGateway" -Name "MyVpnConnection"New-AzVpnClientConnectionThis cmdlet creates a new VPN client connection profile, typically used to download a P2S (Point-to-Site) configuration for a VPN client.
New-AzVpnClientConnection
    -ResourceGroupName <String>
    -VirtualNetworkGatewayName <String>
    -Name <String>
    -VpnClientAddressPool <String[]>
    -VpnClientProtocol <VpnClientProtocol[]>
    -AuthenticationMethod <VpnClientAuthenticationMethod[]>
    [-RadiusServerAddress <String>]
    [-RadiusServerSecret <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [ <CommonParameters> ]-ResourceGroupName: The name of the resource group.-VirtualNetworkGatewayName: The name of the Virtual Network Gateway.-Name: The desired name for the VPN client connection.-VpnClientAddressPool: An array of IP address ranges for the client VPN pool.-VpnClientProtocol: The protocols to use (e.g., 'IkeV2', 'SSTp').-AuthenticationMethod: The authentication method (e.g., 'EapTls', 'AzureActiveDirectory').-RadiusServerAddress: The address of the RADIUS server (if using RADIUS authentication).-RadiusServerSecret: The secret for the RADIUS server (if using RADIUS authentication).Note: To download the client configuration package after creation, use Get-AzVpnClientPackage.
Remove-AzVpnClientConnectionThis cmdlet removes a VPN client connection profile from a Virtual Network Gateway.
Remove-AzVpnClientConnection
    -ResourceGroupName <String>
    -VirtualNetworkGatewayName <String>
    -Name <String>
    [-Force]
    [-DefaultProfile <IAzureContextContainer>]
    [ <CommonParameters> ]-ResourceGroupName: The name of the resource group.-VirtualNetworkGatewayName: The name of the Virtual Network Gateway.-Name: The name of the VPN client connection profile to remove.-Force: Suppresses confirmation prompts.Set-AzVpnClientConnectionThis cmdlet modifies the settings of an existing VPN client connection profile.
Set-AzVpnClientConnection
    -ResourceGroupName <String>
    -VirtualNetworkGatewayName <String>
    -Name <String>
    [-AddVpnClientAddressPool <String[]>]
    [-RemoveVpnClientAddressPool <String[]>]
    [-AddVpnClientProtocol <VpnClientProtocol[]>]
    [-RemoveVpnClientProtocol <VpnClientProtocol[]>]
    [-DefaultProfile <IAzureContextContainer>]
    [ <CommonParameters> ]-ResourceGroupName: The name of the resource group.-VirtualNetworkGatewayName: The name of the Virtual Network Gateway.-Name: The name of the VPN client connection profile to update.-AddVpnClientAddressPool: Adds IP address ranges to the client VPN pool.-RemoveVpnClientAddressPool: Removes IP address ranges from the client VPN pool.-AddVpnClientProtocol: Adds VPN client protocols.-RemoveVpnClientProtocol: Removes VPN client protocols.Get-AzVpnClientConnectionHealthRetrieves the current health status of all active VPN client connections to a Virtual Network Gateway.
Get-AzVpnClientConnectionHealth
    -ResourceGroupName <String>
    -VirtualNetworkGatewayName <String>
    [-DefaultProfile <IAzureContextContainer>]
    [ <CommonParameters> ]-ResourceGroupName: The name of the resource group.-VirtualNetworkGatewayName: The name of the Virtual Network Gateway.Note: This cmdlet provides real-time connection status and can be useful for troubleshooting.
Get-AzVpnClientConnectionConfigurationRetrieves the configuration details for VPN client connections, including download links for client configuration packages.
Get-AzVpnClientConnectionConfiguration
    -ResourceGroupName <String>
    -VirtualNetworkGatewayName <String>
    [-DefaultProfile <IAzureContextContainer>]
    [ <CommonParameters> ]-ResourceGroupName: The name of the resource group.-VirtualNetworkGatewayName: The name of the Virtual Network Gateway.{
    "VpnClientConfigurationPackages": {
        "VpnPackageUrl": "https://myvpngateway.blob.core.windows.net/vpnclientconfig/your_package.zip",
        "Type": "VpnClientPackageVpnClientPackageType"
    },
    // ... other configuration details
}Get-AzVpnClientPackage: Downloads the VPN client configuration package.New-AzVirtualNetworkGateway: Creates a new Azure Virtual Network Gateway.Set-AzVirtualNetworkGateway: Modifies an existing Virtual Network Gateway.When working with scaling templates, ensure that your VPN client connection configurations are robust and can handle changes in the number of gateways or their configurations. The cmdlets discussed here are fundamental to deploying and managing these connections, regardless of the underlying scaling mechanism.
For automated deployments and management within scaling templates, consider the following:
Warning: Modifying VPN client configurations dynamically can impact existing user connections. Plan changes carefully and communicate any disruptions to users.