Task 04: Point-to-Site VPN Connection
DOCUMENT CATEGORY: Runbook
SCOPE: P2S VPN configuration
PURPOSE: Enable remote admin access via P2S VPN
MASTER REFERENCE: Microsoft Learn - P2S VPN
Status: Active
Overview
This task configures Point-to-Site (P2S) VPN on the existing VPN Gateway (Task 02) to allow individual administrators to connect remotely to the Azure management network. P2S VPN is optional — it provides an alternative to Azure Bastion for remote management scenarios.
Execution Target: Azure-Only (control-plane API operation) Tab Profile: 3 tabs — Azure Portal · PowerShell · Azure CLI
This task is optional. It is only required when remote administrative VPN access is needed in addition to or instead of Azure Bastion (Task 05).
Module: azurelocal-toolkit
File: network.tf
Mode: Management
Components Configured
| Resource | Name Pattern | Purpose |
|---|---|---|
| P2S VPN Configuration | On existing VPN Gateway | Remote admin VPN access |
| VPN Client Address Pool | Per config | IP pool for VPN clients |
P2S Configuration
| Setting | Value | Source |
|---|---|---|
| Authentication | Certificate or Entra ID | landing_zone.connectivity.vpn_gateway.point_to_site.authentication |
| Tunnel Type | OpenVPN | landing_zone.connectivity.vpn_gateway.point_to_site.protocols |
| Client Address Pool | Per config | landing_zone.connectivity.vpn_gateway.point_to_site.address_pool |
| Root Certificate | Key Vault reference | landing_zone.connectivity.vpn_gateway.point_to_site.root_certificate |
Prerequisites
- Task 02: VPN Gateway completed — VPN Gateway provisioned
- Root certificate generated and uploaded to Key Vault (if using certificate auth)
- Entra ID application registered (if using Entra ID authentication)
- Client address pool CIDR does not overlap with VNet or on-premises ranges
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, azure.location
landing_zone.connectivity.vpn_gateway.name, .resource_group, .network the gateway
landing_zone.networks[].name, .subscription, .resource_group where the network, and so the gateway, is
landing_zone.subscriptions[].name, .id the subscription that holds the network
landing_zone.connectivity.vpn_gateway.point_to_site.address_pool, .authentication, .protocols, .root_certificate_name, .root_certificate
Single Subscription Model
Landing Zone Placement
| Field | Value | Config Path |
|---|---|---|
| Subscription | Customer subscription | landing_zone.subscriptions[].id |
| Resource Group | Same as VPN Gateway | landing_zone.connectivity.vpn_gateway.resource_group |
| VPN Gateway | Existing gateway | landing_zone.connectivity.vpn_gateway.name |
| Client Pool | Per config | landing_zone.connectivity.vpn_gateway.point_to_site.address_pool |
Execution Options
- Azure Portal
- Orchestrated Script
- Azure CLI
Azure Portal
When to use: Learning Azure Local, single deployment, prefer visual interface
Procedure
- Navigate to VPN Gateway:
- Search for Virtual network gateways → Select the gateway from Task 02
- Configure Point-to-Site:
- Go to Point-to-site configuration → Configure now
| Field | Value | Source |
|-------|-------|--------|
| Address pool | Client CIDR |
landing_zone.connectivity.vpn_gateway.point_to_site.address_pool| | Tunnel type | OpenVPN (SSL) |landing_zone.connectivity.vpn_gateway.point_to_site.protocols| | Authentication type | Azure certificate or Entra ID |landing_zone.connectivity.vpn_gateway.point_to_site.authentication|
-
Upload Root Certificate (if certificate auth): | Field | Value | Source | |-------|-------|--------| | Name | Root cert name |
landing_zone.connectivity.vpn_gateway.point_to_site.root_certificate_name| | Public certificate data | Base64 cert data | From Key Vault | -
Configure Entra ID (if Entra ID auth): | Field | Value | Source | |-------|-------|--------| | Tenant | Entra tenant ID |
azure.tenant_id| | Audience | Entra app ID | no key (the script or Azure decides it) | | Issuer |https://sts.windows.net/{tenant-id}/| Derived from tenant | -
Save the configuration
-
Download VPN Client: Click Download VPN client → Distribute to authorized admins
Validation
- P2S configuration saved on VPN Gateway
- VPN client profile downloadable
- Test client connects successfully
- Client receives IP from configured pool
Links
PowerShell
When to use: Run the task from a management workstation or a pipeline. The script reads
infrastructure.ymland carries no values of its own.
Script
| Script | What it does |
|---|---|
scripts/deploy/02-azure-foundation/phase-04-azure-management-infrastructure/02-manual-deployment/task-04-p2s-vpn-connection/powershell/Configure-P2sVpn.ps1 | Configures point-to-site VPN on the hub VPN gateway that infrastructure.yml describes. Supports -WhatIf. |
Requires: PowerShell 7.
Run
./Configure-P2sVpn.ps1 -InfrastructureFile ./infrastructure.yml -WhatIf
Azure CLI
When to use: Run the task from a host that has the Azure CLI and not the Az PowerShell modules. The script is PowerShell 7 that calls
az; it readsinfrastructure.ymland carries no values of its own.
Script
| Script | What it does |
|---|---|
scripts/deploy/02-azure-foundation/phase-04-azure-management-infrastructure/02-manual-deployment/task-04-p2s-vpn-connection/azurecli/Configure-P2sVpn.azcli.ps1 | Configures point-to-site VPN on the hub VPN gateway that infrastructure.yml describes, with the Azure CLI. Supports -WhatIf. |
Requires: PowerShell 7 and the Azure CLI, signed in with az login --tenant <azure.tenant_id>.
Microsoft Entra ID sign-in (OpenVPN) and certificate sign-in are built; RADIUS is not (exit code 2). A gateway that already has a point-to-site configuration is reported as AlreadyConfigured, or as different and left alone: the script does not change the client configuration of a working gateway. A keyvault:// reference of the root certificate is read with az keyvault secret show (Key Vault Secrets User on the vault). Give users the Azure VPN Client profile from the Azure portal.
Run
./Configure-P2sVpn.azcli.ps1 -InfrastructureFile ./infrastructure.yml -WhatIf
./Configure-P2sVpn.azcli.ps1 -InfrastructureFile ./infrastructure.yml
Validation
- P2S configuration present on VPN Gateway
- VPN client downloads successfully
- Client connects and receives IP from pool
- Client can reach management subnet resources
CAF/WAF Landing Zone Model
In the CAF/WAF model, the P2S configuration exists on the VPN Gateway in the Connectivity subscription.
Landing Zone Placement
| Field | Value | Config Path |
|---|---|---|
| Subscription | Connectivity subscription | landing_zone.subscriptions[].id |
| Resource Group | Connectivity resource group | landing_zone.connectivity.vpn_gateway.resource_group |
| VPN Gateway | Existing gateway | landing_zone.connectivity.vpn_gateway.name |
Execution Options
- Azure Portal
- Orchestrated Script
- Azure CLI
Azure Portal
Follow the same procedure as Single Subscription → Azure Portal, targeting the Connectivity subscription.
Validation
- P2S configured on gateway in Connectivity subscription
- Client receives IP from address pool
PowerShell
When to use: Run the task from a management workstation or a pipeline. The script reads
infrastructure.ymland carries no values of its own.
Script
| Script | What it does |
|---|---|
scripts/deploy/02-azure-foundation/phase-04-azure-management-infrastructure/02-manual-deployment/task-04-p2s-vpn-connection/powershell/Configure-P2sVpn.ps1 | Configures point-to-site VPN on the hub VPN gateway that infrastructure.yml describes. Supports -WhatIf. |
Requires: PowerShell 7.
Run
./Configure-P2sVpn.ps1 -InfrastructureFile ./infrastructure.yml -WhatIf
Azure CLI
When to use: Run the task from a host that has the Azure CLI and not the Az PowerShell modules. The script is PowerShell 7 that calls
az; it readsinfrastructure.ymland carries no values of its own.
Script
| Script | What it does |
|---|---|
scripts/deploy/02-azure-foundation/phase-04-azure-management-infrastructure/02-manual-deployment/task-04-p2s-vpn-connection/azurecli/Configure-P2sVpn.azcli.ps1 | Configures point-to-site VPN on the hub VPN gateway that infrastructure.yml describes, with the Azure CLI. Supports -WhatIf. |
Requires: PowerShell 7 and the Azure CLI, signed in with az login --tenant <azure.tenant_id>.
Microsoft Entra ID sign-in (OpenVPN) and certificate sign-in are built; RADIUS is not (exit code 2). A gateway that already has a point-to-site configuration is reported as AlreadyConfigured, or as different and left alone: the script does not change the client configuration of a working gateway. A keyvault:// reference of the root certificate is read with az keyvault secret show (Key Vault Secrets User on the vault). Give users the Azure VPN Client profile from the Azure portal.
Run
./Configure-P2sVpn.azcli.ps1 -InfrastructureFile ./infrastructure.yml -WhatIf
./Configure-P2sVpn.azcli.ps1 -InfrastructureFile ./infrastructure.yml
Validation
- P2S VPN functional from Connectivity subscription
- No routing conflicts with Hub VNet address space
Troubleshooting
| Issue | Root Cause | Remediation |
|---|---|---|
| Client cannot connect | Root cert not trusted | Verify root cert uploaded correctly |
| No IP assigned to client | Address pool exhausted or misconfigured | Expand pool or verify CIDR |
| Address pool overlaps | CIDR conflicts with VNet or on-prem | Choose non-overlapping CIDR |
| Entra ID auth fails | App registration misconfigured | Verify tenant ID, audience, and API permissions |
| OpenVPN not available | Gateway SKU too low | Upgrade to VpnGw2AZ or higher |
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.
Navigation
| Previous | Up | Next |
|---|---|---|
| Task 03: S2S VPN Connection | Manual Deployment Index | Task 05: Azure Bastion |
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, p2s, remote-access, networking
- Keywords: point-to-site, P2S VPN, remote access, VPN client, certificate authentication, Entra ID
- Author: Hybrid Cloud Solutions
Version Control
| Version | Date | Author | Changes |
|---|---|---|---|
| 1.0.0 | 2025-03-25 | Azure Local Cloud | Initial release |