Skip to main content

Azure Bastion

Azure Bastion is a managed service that gives you RDP and SSH access to VMs through the Azure portal over TLS. The VMs need no public IP address and no inbound management ports open to the internet.

Azure Bastion

Bastion is deployed into your virtual network and proxies remote sessions, so target VMs keep only private IPs. You connect from the portal or a native client over port 443, and Bastion reaches the VM over the private network. It replaces the traditional jump box, which needed its own public IP and constant patching.

How Does an Azure Bastion Session Work?

sequenceDiagram participant A as Admin participant P as Azure portal participant B as Bastion host participant V as Private VM A->>P: Sign in, pick VM P->>B: TLS on 443 B->>V: SSH or RDP, private IP V-->>A: Session streamed back

How Do You Deploy Bastion?

Bastion needs a subnet named exactly AzureBastionSubnet with a /26 or larger address range, and a Standard public IP.

Bash
az network vnet subnet create --name AzureBastionSubnet \
--resource-group mumbai-prod-rg --vnet-name mumbai-prod-vnet \
--address-prefixes 10.20.250.0/26
az network public-ip create --name bastion-pip \
--resource-group mumbai-prod-rg --sku Standard --allocation-method Static
az network bastion create --name mumbai-prod-bastion \
--resource-group mumbai-prod-rg --vnet-name mumbai-prod-vnet \
--public-ip-address bastion-pip --sku Standard --location centralindia

Why It Matters in Production

A fintech team like Razorpay can strip public IPs from every production VM and route all admin sessions through Bastion, which removes the exposed-RDP attack surface that cloud security scans flag constantly. Sessions are also logged centrally.

Security

Bastion only helps if it is the sole way in. Delete any NSG rule that still allows SSH (22) or RDP (3389) from the internet.

Tip

The Standard SKU adds native client support, IP-based connections, and shareable links. The Developer SKU is a low-cost option for connecting to a single VM in dev and test.

Frequently Asked Questions

Is Azure Bastion billed even when nobody is connected?

Yes. Basic, Standard, and Premium SKUs are billed per hour while deployed, plus outbound data, so an unused Bastion in a dev subscription quietly costs money.

Does Bastion work with VMs in peered virtual networks?

Yes. A Bastion host can reach VMs in peered virtual networks with the Basic SKU or higher, so one Bastion in a hub network can serve several spokes.

Do I need an NSG on the Bastion subnet?

No, but if you add one it must allow the specific inbound and outbound rules Bastion documents, such as 443 from the internet and 22 and 3389 to the VM subnets. A missing rule is the usual reason a deployment connects to nothing.

Found a mistake, an outdated step or a broken link?