Skip to main content

Task 02: VPN Gateway

Runbook Azure

DOCUMENT CATEGORY: Runbook
SCOPE: VPN Gateway deployment
PURPOSE: Create VPN Gateway for hybrid connectivity
MASTER REFERENCE: Microsoft Learn - VPN Gateway

Status: Active

Overview​

This task deploys an Azure VPN Gateway into the GatewaySubnet created in Task 01. The gateway provides site-to-site IPsec/IKEv2 connectivity between Azure and on-premises infrastructure with BGP routing support.

Deployment Time

The VPN Gateway takes 30–45 minutes to deploy. Do not interrupt the deployment. Plan accordingly.

Task Classification

Execution Target: Azure-Only (control-plane API operation) Tab Profile: 3 tabs — Azure Portal · PowerShell · Azure CLI

Terraform Reference

Module: azurelocal-toolkit File: network.tf Mode: Management

Components Created​

ResourceName PatternPurpose
Public IPpip-azrlvpng-{env}-{region}-01VPN Gateway public IP
VPN Gatewayvpng-azrl-{env}-{region}-01Site-to-site VPN termination

Gateway Configuration​

SettingValueSource
SKUVpnGw2AZlanding_zone.connectivity.vpn_gateway.sku
GenerationGeneration2no key (the script or Azure decides it)
TypeRoute-basedStandard for Azure Local
Active-ActivePer configThe script or Azure decides it (Terraform route: landing_zone.connectivity.vpn_gateway.active_active, default false)
BGP EnabledPer configno key (the script or Azure decides it)
BGP ASNPer configlanding_zone.connectivity.vpn_gateway.bgp_asn

Prerequisites​

  • Task 01: Virtual Network completed — GatewaySubnet exists
  • Public IP address not already in use
  • BGP ASN confirmed by on-premises network team (must not conflict)

Values from infrastructure.yml​

The script reads these keys from infrastructure.yml (schema 5). Each key, with its type, default and example, is in the variables reference.

azure.tenant_id                                       the tenant the sign-in must belong to
azure.location the region, when the network entry has none
tags tags for the resources created (optional)
landing_zone.connectivity.vpn_gateway.name the gateway name
landing_zone.connectivity.vpn_gateway.resource_group the resource group of the gateway (else the one of the network)
landing_zone.connectivity.vpn_gateway.network the virtual network (an entry of landing_zone.networks)
landing_zone.connectivity.vpn_gateway.sku the SKU (VpnGw1AZ to VpnGw5AZ)
landing_zone.connectivity.vpn_gateway.bgp_asn the BGP ASN of the gateway
landing_zone.networks[].name, .subscription, .resource_group, .location where the network is
landing_zone.subscriptions[].name, .id the subscription that holds the network and so the gateway

The Terraform route (src/terraform/modules/networking) also reads three keys added in registry 5.0.62 (schema 5.6.28, optional):

KeyWhat it is
landing_zone.connectivity.vpn_gateway.public_ip_nameName of the public IP address of the gateway (of its first instance in active-active mode)
landing_zone.connectivity.vpn_gateway.secondary_public_ip_nameName of the public IP address of the second instance; needed when active_active is true
landing_zone.connectivity.vpn_gateway.active_activeActive-active mode (default false): both gateway instances carry tunnels; it needs a route-based VPN, a SKU other than Basic and two Standard static public IPs (About active-active VPN gateways)

Single Subscription Model​

Landing Zone Placement​

FieldValueConfig Path
SubscriptionCustomer subscriptionlanding_zone.subscriptions[].id
Resource Grouprg-azrlmgmt-{env}-{region}-01landing_zone.connectivity.vpn_gateway.resource_group
VPN Gateway Namevpng-azrl-{env}-{region}-01landing_zone.connectivity.vpn_gateway.name
Public IP Namepip-azrlvpng-{env}-{region}-01The script or Azure decides it (Terraform route: landing_zone.connectivity.vpn_gateway.public_ip_name)

Execution Options​

Azure Portal​

When to use: Learning Azure Local, single deployment, prefer visual interface

Procedure​

  1. Create Public IP:
  • Search for Public IP addresses → + Create | Field | Value | Source | |-------|-------|--------| | Name | pip-azrlvpng-{env}-{region}-01 | no key (the script or Azure decides it) | | SKU | Standard | Required for AZ gateway | | Assignment | Static | Required for VPN Gateway | | Availability Zone | Zone-redundant | Best practice |
  1. Create VPN Gateway:
  • Search for Virtual network gateways → + Create | Field | Value | Source | |-------|-------|--------| | Name | vpng-azrl-{env}-{region}-01 | landing_zone.connectivity.vpn_gateway.name | | Region | Your region | landing_zone.connectivity.vpn_gateway.resource_group | | Gateway type | VPN | — | | SKU | VpnGw2AZ | landing_zone.connectivity.vpn_gateway.sku | | Generation | Generation2 | no key (the script or Azure decides it) | | Virtual network | VNet from Task 01 | landing_zone.networks[].name | | Public IP | Public IP created above | no key (the script or Azure decides it) | | Enable active-active | Per config | no key (the script or Azure decides it) |
  1. Configure BGP (if enabled): | Field | Value | Source | |-------|-------|--------| | Configure BGP | Yes | no key (the script or Azure decides it) | | ASN | Per config | landing_zone.connectivity.vpn_gateway.bgp_asn | | Custom Azure APIPA BGP address | Per config | no key (the script or Azure decides it) |

  2. Review + create: Verify → Click Create → Wait 30–45 minutes

Validation​

  • VPN Gateway provisioning state shows Succeeded
  • Public IP assigned and visible
  • BGP settings correct (if enabled)
  • Gateway associated with correct GatewaySubnet

Validation​

  • VPN Gateway provisioning state is Succeeded
  • Public IP assigned
  • Gateway SKU matches config
  • BGP ASN correct (if enabled)

CAF/WAF Landing Zone Model​

In the CAF/WAF model, the VPN Gateway is deployed in the Connectivity subscription alongside the VNet.

Landing Zone Placement​

FieldValueConfig Path
SubscriptionConnectivity subscriptionlanding_zone.subscriptions[].id
Resource Grouprg-azrlconn-{env}-{region}-01landing_zone.connectivity.vpn_gateway.resource_group
VPN Gateway Namevpng-azrl-{env}-{region}-01landing_zone.connectivity.vpn_gateway.name
Public IP Namepip-azrlvpng-{env}-{region}-01The script or Azure decides it (Terraform route: landing_zone.connectivity.vpn_gateway.public_ip_name)

Execution Options​

Azure Portal​

When to use: Learning Azure Local, single deployment, prefer visual interface

Procedure​

Follow the same procedure as Single Subscription → Azure Portal above, but target the Connectivity subscription and resource group:

FieldValue
SubscriptionConnectivity subscription
Resource grouprg-azrlconn-{env}-{region}-01

All other settings (SKU, generation, BGP) remain identical.

Validation​

  • VPN Gateway in Connectivity subscription
  • Provisioning state: Succeeded
  • BGP settings correct

Validation​

  • VPN Gateway in Connectivity subscription
  • Provisioning state: Succeeded
  • BGP ASN matches config
  • Public IP reachable from on-premises firewall

Troubleshooting​

IssueRoot CauseRemediation
Deployment fails after 45 minTransient Azure platform issueRetry; check Azure Status page
GatewaySubnet not foundTask 01 not completedComplete Task 01 first
BGP ASN conflictASN already in use by another gatewayChoose unique ASN in Planning & Discovery
Public IP SKU mismatchBasic SKU used with AZ gatewayUse Standard SKU with zone-redundant allocation
Active-active requires 2 PIPsSingle PIP with active-activeCreate second PIP or disable active-active


Alternatives​

The procedures in this task use the methods shown in the tabs above. The toolkit is PowerShell 7 only and has no Bash scripts. A few tasks that act on Azure also have an Azure CLI script written in PowerShell. The script status page of the toolkit lists which task has which script.

PreviousUpNext
Task 01: Virtual NetworkManual Deployment IndexTask 03: S2S VPN Connection

Version Control

  • Created: 2025-09-15 by Hybrid Cloud Solutions
  • Last Updated: 2026-03-03 by Hybrid Cloud Solutions
  • Version: 4.0.0
  • Tags: azure-local, vpn-gateway, networking, hybrid-connectivity
  • Keywords: VPN gateway, site-to-site, BGP, VpnGw2AZ, hybrid connectivity
  • Author: Hybrid Cloud Solutions

Version Control​

VersionDateAuthorChanges
1.0.02025-03-25Azure Local CloudInitial release