Task 05: Azure Bastion
DOCUMENT CATEGORY: Runbook
SCOPE: Azure Bastion deployment
PURPOSE: Provide secure remote access to management VMs
MASTER REFERENCE: Microsoft Learn - Azure Bastion
Status: Active
Overview
This task deploys Azure Bastion into the AzureBastionSubnet created in Task 01. Bastion provides secure, browser-based RDP and SSH access to management VMs without requiring public IP addresses on target resources.
Execution Target: Azure-Only (control-plane API operation) Tab Profile: 3 tabs — Azure Portal · PowerShell · Azure CLI
Module: azurelocal-toolkit
File: bastion.tf
Mode: Management
Components Created
| Resource | Name Pattern | Purpose |
|---|---|---|
| Public IP | pip-bastion-{env}-{region}-01 | Bastion public IP |
| Azure Bastion | bas-azrl-{env}-{region}-01 | Secure RDP/SSH proxy |
Bastion Configuration
| Setting | Value | Source |
|---|---|---|
| SKU | Standard | landing_zone.connectivity.bastion.sku |
| Subnet | AzureBastionSubnet | landing_zone.networks[].subnets[].name |
| Features | File transfer, shareable links | Standard SKU features |
Prerequisites
- Task 01: Virtual Network completed — AzureBastionSubnet exists with /26 or larger
- Task 06: NSG — Bastion NSG applied (can be done concurrently)
- No existing Bastion deployment in same VNet
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, tags
landing_zone.connectivity.bastion.name, .resource_group, .sku, .network the host, its group, its SKU and its virtual network
landing_zone.networks[].name, .subscription, .resource_group, .location where the network is
landing_zone.subscriptions[].name, .id the subscription that holds the network
The Terraform route (src/terraform/modules/networking) also reads landing_zone.connectivity.bastion.public_ip_name (registry 5.0.62, schema 5.6.28, optional): the name of the public IP address of the Bastion host (Standard SKU, static).
Single Subscription Model
Landing Zone Placement
| Field | Value | Config Path |
|---|---|---|
| Subscription | Customer subscription | landing_zone.subscriptions[].id |
| Resource Group | rg-azrlmgmt-{env}-{region}-01 | landing_zone.connectivity.bastion.resource_group |
| Bastion Name | bas-azrl-{env}-{region}-01 | landing_zone.connectivity.bastion.name |
| Public IP Name | pip-bastion-{env}-{region}-01 | The script or Azure decides it (Terraform route: landing_zone.connectivity.bastion.public_ip_name) |
Execution Options
- Azure Portal
- Orchestrated Script
- Azure CLI
Azure Portal
When to use: Learning Azure Local, single deployment, prefer visual interface
Procedure
- Create Public IP:
- Search for Public IP addresses → + Create
| Field | Value | Source |
|-------|-------|--------|
| Name |
pip-bastion-{env}-{region}-01| no key (the script or Azure decides it) | | SKU | Standard | Required for Bastion | | Assignment | Static | Required for Bastion | | Availability Zone | Zone-redundant | Best practice |
- Create Azure Bastion:
- Search for Bastions → + Create
| Field | Value | Source |
|-------|-------|--------|
| Name |
bas-azrl-{env}-{region}-01|landing_zone.connectivity.bastion.name| | Region | Your region |azure.location| | Tier | Standard |landing_zone.connectivity.bastion.sku| | Virtual network | Management VNet |landing_zone.networks[].name| | Subnet | AzureBastionSubnet (auto-selected) |landing_zone.networks[].subnets[].name| | Public IP | Select PIP from Step 1 | no key (the script or Azure decides it) |
- Review + create: Verify → Click Create → Wait for deployment (~5 minutes)
Validation
- Bastion provisioning state: Succeeded
- Public IP assigned
- Can connect to VM via Bastion from Azure Portal
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-05-azure-bastion/powershell/New-AzureBastion.ps1 | Creates the Azure Bastion host of the hub that infrastructure.yml describes. Supports -WhatIf. |
Requires: PowerShell 7.
Run
./New-AzureBastion.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-05-azure-bastion/azurecli/New-AzureBastion.azcli.ps1 | Creates the Azure Bastion host of the hub 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>.
List a subnet named AzureBastionSubnet of /26 or larger in landing_zone.networks first (Task 01). The host takes about 10 minutes to create and is billed by the hour from then on. The features other than the SKU are the Azure defaults.
Run
./New-AzureBastion.azcli.ps1 -InfrastructureFile ./infrastructure.yml -WhatIf
./New-AzureBastion.azcli.ps1 -InfrastructureFile ./infrastructure.yml
Validation
- Azure Bastion provisioning state: Succeeded
- Public IP assigned and DNS name generated
- Can connect to a management VM via Portal → Connect → Bastion
- File transfer works (Standard SKU)
CAF/WAF Landing Zone Model
In the CAF/WAF model, Azure Bastion is deployed in the Connectivity subscription within the Hub VNet, or optionally in the Management subscription if a spoke Bastion is required.
Landing Zone Placement
| Field | Value | Config Path |
|---|---|---|
| Subscription | Connectivity subscription | landing_zone.subscriptions[].id |
| Resource Group | rg-azrlconn-{env}-{region}-01 | landing_zone.connectivity.bastion.resource_group |
| Bastion Name | bas-azrl-{env}-{region}-01 | landing_zone.connectivity.bastion.name |
| VNet | Hub VNet | landing_zone.networks[].name |
Execution Options
- Azure Portal
- Orchestrated Script
- Azure CLI
Azure Portal
Follow the same procedure as Single Subscription → Azure Portal, targeting the Connectivity subscription and Hub VNet.
Validation
- Bastion in Connectivity subscription
- Can reach spoke VMs via VNet peering
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-05-azure-bastion/powershell/New-AzureBastion.ps1 | Creates the Azure Bastion host of the hub that infrastructure.yml describes. Supports -WhatIf. |
Requires: PowerShell 7.
Run
./New-AzureBastion.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-05-azure-bastion/azurecli/New-AzureBastion.azcli.ps1 | Creates the Azure Bastion host of the hub 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>.
List a subnet named AzureBastionSubnet of /26 or larger in landing_zone.networks first (Task 01). The host takes about 10 minutes to create and is billed by the hour from then on. The features other than the SKU are the Azure defaults.
Run
./New-AzureBastion.azcli.ps1 -InfrastructureFile ./infrastructure.yml -WhatIf
./New-AzureBastion.azcli.ps1 -InfrastructureFile ./infrastructure.yml
Validation
- Bastion deployed in Connectivity subscription
- Bastion can reach spoke VMs through peered VNets
Troubleshooting
| Issue | Root Cause | Remediation |
|---|---|---|
| Bastion deployment fails | AzureBastionSubnet too small | Ensure /26 or larger |
| Cannot connect to VM | NSG blocking Bastion traffic | Apply Bastion NSG rules (Task 06) |
| Bastion DNS not resolving | Propagation delay | Wait 5 minutes and retry |
| File transfer unavailable | Basic SKU deployed | Upgrade to Standard SKU |
| Session disconnects frequently | Network instability | Check Bastion subnet NSG rules |
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 04: P2S VPN Connection | Manual Deployment Index | Task 06: Network Security Groups |
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, bastion, remote-access, security
- Keywords: Azure Bastion, RDP, SSH, browser access, jump host, secure access
- Author: Hybrid Cloud Solutions
Version Control
| Version | Date | Author | Changes |
|---|---|---|---|
| 1.0.0 | 2025-03-25 | Azure Local Cloud | Initial release |