Last updated: May 2026
Azure Networking Intermediate AZ-104 ⏱ 13 min read

Azure VPN Gateway

Azure VPN Gateway creates encrypted tunnels between your Azure VNet and remote locations — whether an on-premises office, branch office, or individual remote worker's device. It uses IPsec/IKE protocols to establish secure connections over the public internet. VPN Gateway is the standard way to connect on-premises networks to Azure when a dedicated private circuit (ExpressRoute) isn't required.

What you'll learn VPN Gateway types and connection scenarios · Site-to-Site VPN · Point-to-Site VPN · VNet-to-VNet VPN · VPN Gateway SKUs · Active-active vs active-passive · BGP support · Creating a VPN Gateway · VPN Gateway vs ExpressRoute

What is VPN Gateway?

VPN Gateway is a specific type of virtual network gateway that sends encrypted traffic between an Azure VNet and an on-premises location across the public internet. Each VNet can have only one VPN Gateway, but the gateway can maintain multiple connections simultaneously.

ℹ️
GatewaySubnet Required VPN Gateway must be deployed into a dedicated subnet named exactly GatewaySubnet (minimum /27, recommend /26). No other resources should be placed in this subnet.

Connection Types

TypeConnectsUse Case
Site-to-Site (S2S)On-premises network ↔ Azure VNetBranch offices, data centres
Point-to-Site (P2S)Individual device ↔ Azure VNetRemote workers, developers
VNet-to-VNetAzure VNet ↔ Azure VNetConnecting VNets across regions/subscriptions
Multi-SiteMultiple on-premises ↔ Azure VNetMultiple branch offices to one VNet

Site-to-Site VPN

S2S creates a persistent encrypted tunnel between your on-premises network and Azure. Requires a VPN device on-premises with a publicly routable IP address.

Requirements

  • On-premises: a compatible VPN device (router/firewall) with static public IP
  • Azure: VPN Gateway in GatewaySubnet + Local Network Gateway (represents on-premises)
  • Non-overlapping address spaces
  • Shared pre-shared key for authentication
Azure CLICreate S2S VPN connection
# 1. Create VPN Gateway (takes 30-45 minutes)
az network vnet-gateway create \
  --name myVpnGateway \
  --resource-group myRG \
  --vnet myVNet \
  --gateway-type Vpn \
  --vpn-type RouteBased \
  --sku VpnGw1 \
  --public-ip-address myGatewayPublicIP

# 2. Create Local Network Gateway (represents on-premises)
az network local-gateway create \
  --name myLocalGateway \
  --resource-group myRG \
  --gateway-ip-address 203.0.113.10 \
  --local-address-prefixes 192.168.0.0/24 \
  --location centralindia

# 3. Create the connection
az network vpn-connection create \
  --name myS2SConnection \
  --resource-group myRG \
  --vnet-gateway1 myVpnGateway \
  --local-gateway2 myLocalGateway \
  --shared-key MySecretKey123!

Point-to-Site VPN

P2S allows individual computers to connect to Azure VNet from anywhere — no on-premises VPN device needed. Each user installs a VPN client on their device.

Authentication Options

  • Certificate authentication — Root and client certificates (most common)
  • Azure AD authentication — Uses Azure Active Directory credentials
  • RADIUS authentication — Integrates with on-premises RADIUS server

VPN Protocols

  • OpenVPN — Works on Windows, Mac, Linux, iOS, Android
  • SSTP — Windows only, uses HTTPS port 443
  • IKEv2 — Windows and Mac

VNet-to-VNet VPN

Connects two Azure VNets via encrypted tunnels. Both VNets need their own VPN Gateway. Traffic is encrypted — unlike VNet Peering (no encryption, lower latency). Use VNet Peering instead unless you specifically need encryption or are connecting across Azure Government/China clouds.

VPN Gateway SKUs

SKUThroughputS2S TunnelsP2S ConnectionsBGP
Basic100 Mbps10128No
VpnGw1650 Mbps30250Yes
VpnGw21 Gbps30500Yes
VpnGw31.25 Gbps301,000Yes
VpnGw45 Gbps1005,000Yes
VpnGw510 Gbps10010,000Yes
⚠️
VPN Gateway Takes 30–45 Minutes to Deploy Creating a VPN Gateway is slow — it provisions dedicated infrastructure. Plan accordingly. Also, the Basic SKU does not support BGP, zone redundancy, or Active-Active mode — avoid for production.

Active-Active vs Active-Passive

Active-Passive (default)Active-Active
Instances2 (one active, one standby)2 (both active)
Failover10-15 secondsNear-instant
ThroughputSingle instanceBoth instances
Public IPs12
Best forCost-sensitiveProduction HA

BGP Support

BGP (Border Gateway Protocol) enables dynamic routing between Azure and on-premises networks. Instead of manually configuring static routes, BGP automatically exchanges routing information — essential for complex network topologies and multiple on-premises sites.

VPN Gateway vs ExpressRoute

FactorVPN GatewayExpressRoute
ConnectionOver public internet (encrypted)Private dedicated circuit
BandwidthUp to 10 GbpsUp to 100 Gbps
LatencyVariable (internet)Consistent, low
SLA99.95% (active-active)99.95%
Setup timeMinutes to hoursWeeks (requires provider)
CostLowerHigher
Best forSmaller workloads, remote accessEnterprise, high bandwidth, compliance
💡
AZ-104 Exam Tip Know the three VPN connection types (S2S, P2S, VNet-to-VNet). Know GatewaySubnet must be /27 minimum. Know that VPN uses public internet (encrypted) while ExpressRoute is private. Know active-active provides higher availability than active-passive.
📝 Practice Questions
Click an option to check your answer.
Q1. What connection type allows individual remote workers to connect to Azure VNet from their laptops?
A — Site-to-Site VPN
B — Point-to-Site VPN
C — VNet-to-VNet VPN
D — ExpressRoute
Q2. What is the minimum subnet size required for GatewaySubnet?
A — /28
B — /27
C — /26
D — /24
Q3. Why would you choose ExpressRoute over VPN Gateway for an enterprise workload?
A — ExpressRoute is cheaper
B — ExpressRoute is faster to deploy
C — Private circuit, consistent latency, higher bandwidth, no public internet exposure
D — Stronger encryption than VPN Gateway
Q4. In active-active VPN Gateway mode, what is the failover time compared to active-passive?
A — 10-15 seconds
B — Near-instant — both instances are active simultaneously
C — 5 minutes
D — No failover — manual intervention required
Q5. Can one Azure VNet have multiple VPN Gateways?
A — Yes — up to 5 per VNet
B — No — each VNet can only have one VPN Gateway
C — Yes — one per SKU tier
D — Yes — unlimited
Comments
Disclaimer: RedKite Cloud is an independent educational resource and is not affiliated with Microsoft Corporation.