What is Azure Bastion?
Azure Bastion is a fully managed PaaS service that provides secure, seamless RDP and SSH connectivity to your VMs directly from the Azure Portal — over TLS (HTTPS, port 443). Your VMs don't need public IP addresses, and you don't need to open SSH (22) or RDP (3389) ports to the internet.
How Bastion Works
Here's the connection flow when you use Azure Bastion:
- You open the Azure Portal in your browser (HTTPS, port 443)
- You navigate to your VM and click Connect → Bastion
- Your browser connects to the Bastion host — which lives inside your VNet in a dedicated subnet called AzureBastionSubnet
- Bastion connects to your VM using its private IP address over the VNet — SSH port 22 or RDP port 3389, but only on the internal network
- The terminal or desktop session streams back to your browser over the already-open HTTPS connection
Bastion SKUs
Azure Bastion comes in three tiers:
| SKU | Key Features | Approx Cost/Month |
|---|---|---|
| Developer | Single VM at a time, no dedicated subnet needed, no public IP required | Free (preview) |
| Basic | RDP/SSH from browser, shareable links not supported, 2 instances | ~₹5,000/month |
| Standard | All Basic features + file upload/download, native client support, shareable links, scaling up to 50 instances | ~₹9,000–12,000/month |
| Premium | All Standard features + session recording, private-only Bastion, IP-based connection | ~₹18,000+/month |
Deploying Azure Bastion
Requirements
- A Virtual Network with an AzureBastionSubnet subnet (minimum /26 size)
- A Standard SKU Public IP address assigned to Bastion
- The subnet must be named exactly AzureBastionSubnet — no other name is accepted
Via Azure Portal
- Search for Bastions in the portal
- Click + Create
- Select your subscription, resource group, and region
- Give it a name (e.g.,
bastion-prod) - Select your VNet — Azure will create the AzureBastionSubnet automatically if it doesn't exist
- Create or select a Public IP for Bastion
- Select the SKU (Basic for getting started)
- Click Review + Create → Create
Deployment takes about 5–10 minutes.
Via Azure CLI
# Create the AzureBastionSubnet in your VNet
az network vnet subnet create \
--resource-group myResourceGroup \
--vnet-name myVNet \
--name AzureBastionSubnet \
--address-prefixes 10.0.1.0/26
# Create a public IP for Bastion
az network public-ip create \
--resource-group myResourceGroup \
--name bastion-pip \
--sku Standard \
--location centralindia
# Create the Bastion host
az network bastion create \
--resource-group myResourceGroup \
--name bastion-prod \
--public-ip-address bastion-pip \
--vnet-name myVNet \
--location centralindia \
--sku Basic
Connecting to VMs via Bastion
Once Bastion is deployed:
- Go to your VM in the Azure Portal
- Click Connect in the top menu
- Select Bastion
- Enter your credentials (username + password, or username + SSH key)
- Click Connect
- A new browser tab opens with your SSH terminal or RDP desktop
Native Client Support (Standard SKU)
The Standard SKU also supports connecting via your local SSH or RDP client (not just the browser). This is useful if you prefer a full-featured client with copy-paste, multiple tabs, etc.
az network bastion ssh \
--name bastion-prod \
--resource-group myResourceGroup \
--target-resource-id /subscriptions/.../virtualMachines/myVM \
--auth-type ssh-key \
--username azureuser \
--ssh-key ~/.ssh/id_rsa
Bastion vs Direct SSH/RDP
| Factor | Direct SSH/RDP | Azure Bastion |
|---|---|---|
| VM needs public IP? | Yes | No |
| Ports 22/3389 exposed? | Yes — to internet | No — internal only |
| Client required? | SSH/RDP client app | Just a browser |
| Works on any device? | Needs client app | Yes — any browser |
| Cost | Free | ~₹5,000–18,000/month |
| Security | Depends on NSG/JIT | High — no internet exposure |
| Best for | Dev/test, learning | Production environments |
Cost Considerations
Azure Bastion is charged per deployment hour plus per outbound data. Key points:
- You pay for Bastion even when no one is connected — it's always-on infrastructure
- One Bastion host covers all VMs in the same VNet (and peered VNets)
- For a large team accessing many VMs, one Bastion host is far cheaper than giving each VM a public IP
- For a single dev VM you use occasionally, direct SSH with an IP-restricted NSG may be more cost-effective
Best Practices
- Use Bastion for all production VMs — Never expose port 22 or 3389 on production systems
- One Bastion per VNet — A single Bastion host covers all VMs in the VNet
- Remove public IPs from VMs behind Bastion — If you're using Bastion, VMs don't need public IPs at all
- Use Standard SKU for teams — File transfer and native client support are essential for real teams
- Developer SKU for learning — Free, no infrastructure setup required