Home › Studies › AZ-104 › Virtual Networking › Azure Bastion

Azure Bastion

SKUs · AzureBastionSubnet · NSG rules · native client · roles · CLI and PowerShell

By the tools4free.dev team · Last reviewed November 13, 2026

Practice questions for this topic →

SKUs

SKUInfrastructureWhat it adds
DeveloperFree, shared infrastructure, one VM at a time, select regionsNo peering support. No AzureBastionSubnet or public IP needed
BasicDedicated, fixed at 2 instancesPeered vnets are supported (Basic and higher)
StandardDedicated, host scaling of 2 to 50 instancesNative client, shareable links, IP-based connect, custom ports, file transfer
PremiumStandard, plus session recordingSession recording and private-only deployment (no public IP)

Azure Bastion gives RDP and SSH over TLS (port 443) from the Azure portal or a native client. Target VMs need no public IP, no agent and no client software. Bastion connects to the VM's private IP. Billing starts when Bastion is deployed, whatever the usage.

Deployment requirements

Deployment order: vnet, then AzureBastionSubnet, then a Standard static public IP, then the Bastion host with its SKU, then connect from the VM's Connect › Bastion.

Connecting and roles

Upgrades and limits

ItemValue
Upgrades (Developer to a dedicated SKU, Basic to Standard to Premium)Supported, about 10 minutes
DowngradesNot supported: delete and recreate
InstancesBasic 2 (fixed); Standard and Premium 2 to 50
Sessions per instance20 RDP and 40 SSH
Basic maximum40 RDP and 80 SSH
At 50 instances1,000 RDP and 2,000 SSH
Default ports3389 RDP, 22 SSH; custom ports need Standard or higher

NSG rules on AzureBastionSubnet

If you add an NSG to AzureBastionSubnet, you must create all of these rules.

DirectionRuleSourceDestinationPorts
InboundAllowHttpsInboundInternetany443 TCP
InboundAllowGatewayManagerInboundGatewayManagerany443 TCP
InboundAllowAzureLoadBalancerInboundAzureLoadBalancerany443 TCP
InboundAllowBastionHostCommunicationVirtualNetworkVirtualNetwork8080, 5701
OutboundAllowSshRdpOutboundanyVirtualNetwork22, 3389 (use the VirtualNetwork tag if custom ports)
OutboundAllowAzureCloudOutboundanyAzureCloud443 TCP
OutboundAllowBastionCommunicationVirtualNetworkVirtualNetwork8080, 5701
OutboundAllowHttpOutboundanyInternet80

The NSG on the target VM's subnet must allow inbound 3389 or 22 (or your custom port) from the AzureBastionSubnet range. Ports 3389 and 22 aren't needed on AzureBastionSubnet itself.

CLI and PowerShell

TaskCommand
Create the subnetaz network vnet subnet create --name AzureBastionSubnet --resource-group TestRG1 --vnet-name VNet1 --address-prefix 10.1.1.0/26
Create the public IPaz network public-ip create --resource-group TestRG1 --name VNet1-ip --sku Standard --location eastus
Create Bastion (CLI)az network bastion create --name VNet1-bastion --public-ip-address VNet1-ip --resource-group TestRG1 --vnet-name VNet1 --location eastus --sku Basic. In the CLI, omitting --sku gives Standard. --scale-units defaults to 2.
Create Bastion (PowerShell)New-AzBastion -ResourceGroupName "BastionPowershellTest" -Name "testBastion2" -PublicIpAddressRgName ... -PublicIpAddressName ... -VirtualNetworkRgName ... -VirtualNetworkName ... -Sku "Standard" -ScaleUnit 3. In PowerShell, -Sku defaults to Basic.
Developer SKUaz network bastion create --name MyBastion --resource-group MyResourceGroup --sku Developer --vnet-name MyVnet (no subnet or public IP needed)
Turn on native clientaz network bastion update --name MyBastionHost --resource-group MyResourceGroup --enable-tunneling
Native SSHaz network bastion ssh --name MyBastionHost --resource-group MyResourceGroup --target-resource-id vmResourceId --auth-type password --username xyz (--auth-type is required)
Native RDPaz network bastion rdp --name MyBastionHost --resource-group MyResourceGroup --target-resource-id vmResourceId
Tunnelaz network bastion tunnel --name MyBastionHost --resource-group MyResourceGroup --target-resource-id vmResourceId --resource-port 22 --port 50022

az network bastion is an Azure CLI extension that installs on first use. Feature flags such as --enable-tunneling, --enable-ip-connect, --shareable-link, --file-copy and --session-recording default to off.

Exam Tips

Tick each tip once you can answer it without looking.

“Name of the subnet for a dedicated Bastion deployment” → AzureBastionSubnet (exact name). Trap: BastionSubnet or any other name.

“Smallest AzureBastionSubnet for a new deployment” → /26. Trap: a /27 only still works for deployments made before Nov 2, 2021.

“Public IP for a dedicated Bastion host” → Standard SKU, Static allocation. Trap: a Basic SKU public IP.

“Connect with a native RDP or SSH client, or az network bastion rdp” → Standard or Premium SKU with Native Client Support turned on. Trap: Basic does not support it.

“Basic Bastion must become Standard” → Upgrade in place (about 10 minutes). Trap: redeploying is not needed.

“Downgrade Premium to Standard” → Not supported: delete and recreate. Trap: changing the SKU on the Configuration page.

“Record user sessions for audit” → Premium SKU with session recording. Trap: Standard with diagnostic logs.

“Dedicated Bastion host with no public IP” → Premium private-only deployment. Trap: Basic or Standard, which need a Standard static public IP (Developer needs none either, but it is shared and serves one VM at a time).

“One Bastion in the hub for VMs in peered spokes” → Supported on Basic or higher; users also need Reader on the peered vnet. Trap: a Bastion per vnet is not required.

“Bastion reaching VMs in a peered vnet in another Entra tenant” → Not supported (same tenant across subscriptions is fine). Trap: any peering works.

“UDR 0.0.0.0/0 on AzureBastionSubnet to send traffic to a firewall” → Not supported. Trap: treating it as a compliance requirement.

“ExpressRoute advertises 0.0.0.0/0 into the Bastion vnet and Bastion stops working” → A default route advertised into the vnet breaks Bastion. Trap: Bastion is unaffected by it.

“Minimum roles for a user to connect” → Reader on the VM, the NIC and the Bastion (plus Reader on the vnet if peered). Trap: Virtual Machine Contributor.

“NSG on AzureBastionSubnet: inbound port from the Internet” → TCP 443 (and 443 from GatewayManager). Trap: opening 3389 or 22.

“NSG on the target VM subnet” → Allow 3389 or 22 from the AzureBastionSubnet range. Trap: allowing them from the Internet.

“Move a vnet that holds a Bastion to another resource group” → Delete Bastion first, redeploy after the move. Trap: Bastion moving along with the vnet.

“Does the target VM need a public IP or an agent?” → Neither. Trap: a public IP for portal connections.

“az network bastion create with no --sku” → Standard (the CLI default). Trap: in PowerShell, New-AzBastion -Sku defaults to Basic, so the two tools differ.

“Scale Bastion out beyond 2 instances” → Standard or Premium host scaling (2 to 50). Trap: Basic is fixed at 2.

Sources

Checked against Microsoft Learn on November 13, 2026.

← NSGs & ASGsService & Private Endpoints →