Azure Virtual Network Gateway VPN Client Connection Cmdlets

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.

Overview

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.

Cmdlets for VPN Client Connection Management

The primary cmdlets for managing VPN client connections include:

Get-AzVpnClientConnection

This cmdlet retrieves information about VPN client connections. You can filter results by gateway name, resource group, or connection name.

Syntax

Get-AzVpnClientConnection
    [-ResourceGroupName <String>]
    [-VirtualNetworkGatewayName <String>]
    [-Name <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [ <CommonParameters> ]

Parameters

Example

Get-AzVpnClientConnection -ResourceGroupName "MyResourceGroup" -VirtualNetworkGatewayName "MyVpnGateway" -Name "MyVpnConnection"

New-AzVpnClientConnection

This cmdlet creates a new VPN client connection profile, typically used to download a P2S (Point-to-Site) configuration for a VPN client.

Syntax

New-AzVpnClientConnection
    -ResourceGroupName <String>
    -VirtualNetworkGatewayName <String>
    -Name <String>
    -VpnClientAddressPool <String[]>
    -VpnClientProtocol <VpnClientProtocol[]>
    -AuthenticationMethod <VpnClientAuthenticationMethod[]>
    [-RadiusServerAddress <String>]
    [-RadiusServerSecret <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [ <CommonParameters> ]

Parameters

Note: To download the client configuration package after creation, use Get-AzVpnClientPackage.

Remove-AzVpnClientConnection

This cmdlet removes a VPN client connection profile from a Virtual Network Gateway.

Syntax

Remove-AzVpnClientConnection
    -ResourceGroupName <String>
    -VirtualNetworkGatewayName <String>
    -Name <String>
    [-Force]
    [-DefaultProfile <IAzureContextContainer>]
    [ <CommonParameters> ]

Parameters

Set-AzVpnClientConnection

This cmdlet modifies the settings of an existing VPN client connection profile.

Syntax

Set-AzVpnClientConnection
    -ResourceGroupName <String>
    -VirtualNetworkGatewayName <String>
    -Name <String>
    [-AddVpnClientAddressPool <String[]>]
    [-RemoveVpnClientAddressPool <String[]>]
    [-AddVpnClientProtocol <VpnClientProtocol[]>]
    [-RemoveVpnClientProtocol <VpnClientProtocol[]>]
    [-DefaultProfile <IAzureContextContainer>]
    [ <CommonParameters> ]

Parameters

Get-AzVpnClientConnectionHealth

Retrieves the current health status of all active VPN client connections to a Virtual Network Gateway.

Syntax

Get-AzVpnClientConnectionHealth
    -ResourceGroupName <String>
    -VirtualNetworkGatewayName <String>
    [-DefaultProfile <IAzureContextContainer>]
    [ <CommonParameters> ]

Parameters

Note: This cmdlet provides real-time connection status and can be useful for troubleshooting.

Get-AzVpnClientConnectionConfiguration

Retrieves the configuration details for VPN client connections, including download links for client configuration packages.

Syntax

Get-AzVpnClientConnectionConfiguration
    -ResourceGroupName <String>
    -VirtualNetworkGatewayName <String>
    [-DefaultProfile <IAzureContextContainer>]
    [ <CommonParameters> ]

Parameters

Example Output Snippet

{
    "VpnClientConfigurationPackages": {
        "VpnPackageUrl": "https://myvpngateway.blob.core.windows.net/vpnclientconfig/your_package.zip",
        "Type": "VpnClientPackageVpnClientPackageType"
    },
    // ... other configuration details
}

Related Cmdlets

Considerations for Scaling Templates

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.