VPN Gateway Reference

REST API

Manage Azure VPN gateways using the Azure Resource Manager REST API.

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{gatewayName}?api-version=2024-05-01
ParameterTypeDescription
subscriptionIdstringAzure subscription identifier.
resourceGroupNamestringName of the resource group.
gatewayNamestringName of the virtual network gateway.
api-versionstringAPI version, e.g., 2024-05-01.

PowerShell Cmdlets

Common PowerShell commands for VPN Gateway.

# Create a new VPN gateway
New-AzVirtualNetworkGateway -Name "myVpnGw" -ResourceGroupName "RG1" -Location "EastUS" -GatewayType Vpn -VpnType RouteBased -Sku "VpnGw1"

# Get gateway details
Get-AzVirtualNetworkGateway -Name "myVpnGw" -ResourceGroupName "RG1"

# Delete a VPN gateway
Remove-AzVirtualNetworkGateway -Name "myVpnGw" -ResourceGroupName "RG1" -Force

Azure CLI

Examples using az network vnet-gateway.

# Create a VPN gateway
az network vnet-gateway create \
  --name myVpnGw \
  --resource-group RG1 \
  --vnet myVnet \
  --public-ip-address myVpnGwIp \
  --gateway-type Vpn \
  --vpn-type RouteBased \
  --sku VpnGw1

# Show gateway info
az network vnet-gateway show \
  --name myVpnGw \
  --resource-group RG1

# Delete gateway
az network vnet-gateway delete \
  --name myVpnGw \
  --resource-group RG1

Configuration Settings

Key configuration properties for a VPN gateway.

PropertyAllowed ValuesDescription
gatewayTypeVpn, ExpressRouteType of gateway.
vpnTypePolicyBased, RouteBasedVPN routing method.
skuVpnGw1, VpnGw2, VpnGw3, Basic, Standard, HighPerformancePerformance tier.
enableBgptrue, falseEnables BGP for dynamic routing.
activeActivetrue, falseActive‑active mode for high availability.

Related Topics