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
Parameter | Type | Description |
---|---|---|
subscriptionId | string | Azure subscription identifier. |
resourceGroupName | string | Name of the resource group. |
gatewayName | string | Name of the virtual network gateway. |
api-version | string | API 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.
Property | Allowed Values | Description |
---|---|---|
gatewayType | Vpn, ExpressRoute | Type of gateway. |
vpnType | PolicyBased, RouteBased | VPN routing method. |
sku | VpnGw1, VpnGw2, VpnGw3, Basic, Standard, HighPerformance | Performance tier. |
enableBgp | true, false | Enables BGP for dynamic routing. |
activeActive | true, false | Active‑active mode for high availability. |