Exposing RDP or SSH to the internet is still one of the most common ways virtual machines get compromised. Azure Bastion removes that problem: you connect to your VMs over TLS through the Azure portal or your own RDP/SSH client, and the VMs don’t need a public IP address at all.
In this post I’ll explain how Azure Bastion works under the hood, walk through the four SKUs (Developer, Basic, Standard and Premium), and show which one fits which situation, including the network requirements, native client commands and a Bicep example.
How Azure Bastion works
Azure Bastion is a fully managed PaaS service that you deploy into your virtual network. A connection always follows the same path:
- You open a session from the Azure portal (HTML5, in the browser) or from your local client (the native client feature).
- Your client connects to Bastion over TLS on port 443. Entra ID and Azure RBAC decide whether you may connect at all.
- Bastion opens the RDP (3389) or SSH (22) session to the private IP of the target VM inside the virtual network.
The result: no public IPs on your VMs, no jump boxes to patch, no inbound RDP/SSH from the internet, and one central point for access and logging. Microsoft maintains and hardens the Bastion hosts for you.
To connect through Bastion you need at least Reader on the virtual machine, its network interface (and the NIC’s private IP) and the Bastion resource. Signing in to the operating system itself still uses the VM’s local or domain credentials, an SSH key, or Microsoft Entra ID where supported.
The four SKUs at a glance
| Feature | Developer | Basic | Standard | Premium |
|---|---|---|---|---|
| Cost | Free | Hourly | Hourly + per extra instance | Hourly + per extra instance |
| Infrastructure | Shared | Dedicated | Dedicated | Dedicated |
| Needs AzureBastionSubnet (/26) | No | Yes | Yes | Yes |
| Concurrent connections | 1 VM at a time | 2 instances (about 40 RDP / 80 SSH) | 2–50 instances (up to about 1,000 RDP / 2,000 SSH) | Same as Standard |
| VMs in peered VNets | No | Yes | Yes | Yes |
| Native client (mstsc / ssh / az CLI) | No | No | Yes | Yes |
| File transfer | No | No | Yes (native client) | Yes (native client) |
| IP-based connection (e.g. on-premises servers) | No | No | Yes | Yes |
| Shareable links | No | No | Yes | Yes |
| Custom ports | No | No | Yes | Yes |
| Session recording | No | No | No | Yes |
| Private-only (no public IP) | No | No | No | Yes |
Session counts depend on the workload: heavy RDP sessions (video, large screens) use more capacity per instance than light admin work.
Upgrading and downgradingYou can upgrade a Bastion host to a higher SKU in place (Developer → Basic → Standard → Premium). Downgrading is not supported: you have to delete the Bastion host and deploy it again with the lower SKU.
Developer: free, for dev/test
The Developer SKU runs on infrastructure shared with other customers, so there is nothing to deploy into your network: no AzureBastionSubnet and no public IP. You enable it on a virtual network and connect from the portal.
The trade-offs are big: one connection at a time, no virtual network peering (only VMs in that VNet), portal connections only, and it’s available in a limited set of regions. Microsoft explicitly positions it for dev/test, not production. It’s a perfect fit for a lab subscription or for occasionally logging into a test VM without paying for a dedicated host.
Basic: dedicated, fixed capacity
Basic is the first SKU with dedicated hosts in your own virtual network. It always runs two instances, supports concurrent connections and, importantly, reaches VMs in peered virtual networks. That makes it usable in a hub-and-spoke design: one Bastion in the hub serves every spoke.
What it lacks: you can only connect through the portal, so there’s no native client, file transfer, custom ports or IP-based connections.
Standard: the feature-complete workhorse
Standard adds everything administrators usually ask for:
- Host scaling: 2 to 50 instances (scale units), so it grows with the number of concurrent sessions.
- Native client: connect with your own mstsc or ssh through the Azure CLI, including multi-monitor RDP and Microsoft Entra ID sign-in for supported VMs.
- File transfer: upload and download files over native client sessions.
- IP-based connection: connect to any reachable private IP, including servers on-premises over ExpressRoute or VPN.
- Shareable links: give someone a link to one VM without giving them access to the Azure portal.
- Custom ports: for VMs that listen on non-default RDP/SSH ports.
Most native client, file transfer, IP-based connection and shareable link features are turned off by default. Enable them on the Bastion resource under Configuration or in your template (see the Bicep example below).
Premium: compliance and private-only
Premium includes everything from Standard and adds two features aimed at regulated environments:
- Session recording: graphical sessions (made through the portal) are recorded to a blob container in a storage account you own, so you can replay exactly what happened.
- Private-only deployment: the Bastion host gets no public IP address at all and is reachable only over private connectivity such as ExpressRoute private peering.
Microsoft now recommends Premium for production environments with strict security and audit requirements.
Network requirements
All dedicated SKUs (Basic, Standard and Premium) need:
- A subnet named exactly AzureBastionSubnet, at least /26. Size it at /26 from the start: Standard and Premium need the room to scale out.
- A Standard SKU, static public IP, except for Premium private-only deployments.
A network security group on AzureBastionSubnet is optional, but if you add one it must allow the Bastion control and data plane traffic, or deployments and connections will fail:
| Direction | Source | Destination | Port | Purpose |
|---|---|---|---|---|
| Inbound | Internet (or your client ranges) | Any | 443 | Users connecting to Bastion |
| Inbound | GatewayManager | Any | 443 | Control plane |
| Inbound | AzureLoadBalancer | Any | 443 | Health probes |
| Inbound | VirtualNetwork | VirtualNetwork | 8080, 5701 | Bastion data plane |
| Outbound | Any | VirtualNetwork | 22, 3389 | Sessions to the target VMs (add custom ports here) |
| Outbound | Any | AzureCloud | 443 | Diagnostics and Azure endpoints |
| Outbound | VirtualNetwork | VirtualNetwork | 8080, 5701 | Bastion data plane |
| Outbound | Any | Internet | 80 | Session and certificate validation |
On the target VMs, only allow RDP/SSH from the AzureBastionSubnet address range, and nothing from the internet.
Route tables and forced tunnelingDon’t associate a route table that sends 0.0.0.0/0 to a firewall or NVA with AzureBastionSubnet. Bastion needs a direct path for its control plane; forced tunneling on that subnet breaks it. Inspect the traffic on the spoke side instead.
Connecting with the native client
With Standard or Premium and Native client support enabled, you can skip the browser and use your own tools through the Azure CLI. First add the extensions:
az extension add --name bastion
az extension add --name ssh # only needed for Microsoft Entra ID SSH sign-in
RDP to a Windows VM (from a Windows machine; opens mstsc):
az network bastion rdp --name bas-hub-prd-001 --resource-group rg-network-hub-prd-001 `
--target-resource-id /subscriptions/<sub-id>/resourceGroups/rg-app-prd-001/providers/Microsoft.Compute/virtualMachines/vm-app-prd-001
SSH to a Linux VM with an SSH key, or with Microsoft Entra ID (--auth-type AAD):
az network bastion ssh --name bas-hub-prd-001 --resource-group rg-network-hub-prd-001 \
--target-resource-id <vm-resource-id> \
--auth-type ssh-key --username azureuser --ssh-key ~/.ssh/id_ed25519
Tunnel: forward a local port to a VM, so you can use any SSH or SCP tool, or reach a custom port:
az network bastion tunnel --name bas-hub-prd-001 --resource-group rg-network-hub-prd-001 \
--target-resource-id <vm-resource-id> --resource-port 22 --port 50022
# in a second terminal
ssh -p 50022 [email protected]
scp -P 50022 ./backup.tar.gz [email protected]:/tmp/
IP-based connection: replace --target-resource-id with --target-ip-address 10.10.1.4 to reach a server that isn’t an Azure VM, for example on-premises over ExpressRoute or VPN.
Deploying Bastion Standard with Bicep
A minimal example that deploys a Standard Bastion host into an existing hub virtual network, with the most-used features enabled. Change skuName to Premium to unlock session recording and private-only mode.
param location string = resourceGroup().location
param vnetName string = 'vnet-hub-prd-001'
param bastionName string = 'bas-hub-prd-001'
@allowed([ 'Basic', 'Standard', 'Premium' ])
param skuName string = 'Standard'
resource vnet 'Microsoft.Network/virtualNetworks@2024-05-01' existing = {
name: vnetName
}
resource bastionSubnet 'Microsoft.Network/virtualNetworks/subnets@2024-05-01' existing = {
parent: vnet
name: 'AzureBastionSubnet' // must exist, /26 or larger
}
resource pip 'Microsoft.Network/publicIPAddresses@2024-05-01' = {
name: 'pip-${bastionName}'
location: location
sku: { name: 'Standard' }
properties: { publicIPAllocationMethod: 'Static' }
}
resource bastion 'Microsoft.Network/bastionHosts@2024-05-01' = {
name: bastionName
location: location
sku: { name: skuName }
properties: {
scaleUnits: 2 // Standard/Premium: 2-50
enableTunneling: true // native client support
enableFileCopy: true // file transfer via native client
enableIpConnect: true // IP-based connection
enableShareableLink: false
disableCopyPaste: false
ipConfigurations: [
{
name: 'ipconfig1'
properties: {
subnet: { id: bastionSubnet.id }
publicIPAddress: { id: pip.id }
}
}
]
}
}
Keeping the cost under control
- Billing is hourly for the dedicated SKUs, whether anyone is connected or not, plus each extra Standard/Premium instance above the included two, plus outbound data transfer (the first 5 GB per month is free). Check the Azure Bastion pricing page for current prices in your region.
- Use one Bastion per hub, not per spoke. Basic and higher reach peered VNets, so a single host can serve a whole landing zone.
- Use Developer for labs. It’s free and good enough for occasional access to test VMs.
- Scale units, not SKU, for capacity. Start Standard at 2 instances and scale up only when concurrent sessions require it.
- Deploy on demand in non-production: deploy Bastion with your template when you need it and remove it afterwards. Deployment takes a few minutes.
What's new in 2026
A few recent additions worth knowing about. All of them were still in public preview at the time of writing, so check the What’s new page for their current status:
- Managed identity for session recording (Premium): Bastion writes recordings to your storage account with Microsoft Entra ID instead of a SAS URL.
- IPv6 dual stack support for Bastion.
- AI-assisted session review: RDP vision and SSH vision summarize recorded sessions and flag risky activity, and SSH command logs capture the commands run during SSH sessions.
Which SKU should you choose?
- Developer: lab or dev/test, one person, VMs in a single VNet, zero budget.
- Basic: small production environments that only need browser-based RDP/SSH, including to peered spokes.
- Standard: the default for most organizations. Native client, file transfer, on-premises servers via IP-based connection, and scaling.
- Premium: regulated environments that need session recording or a Bastion without any public IP.
Whatever you pick: remove the public IPs from your VMs, close RDP and SSH to the internet, and let Bastion be the only way in.
Sources: Choose the right Azure Bastion SKU, What is Azure Bastion?, Working with NSG access and Azure Bastion.
