Deploy Azure Bastion and Connect to the VM

Lab overview

vm-surfcity-01 is running privately with no public IP, which means Surf City IT has no way to sign in to it yet. In this lab you add the dedicated AzureBastionSubnet (10.10.0.0/26) to vnet-surfcity, deploy a Basic-tier Bastion host named bas-surfcity with a Standard, static, zone-redundant public IP, and then open a full Windows Server desktop session to the VM from the portal using the surfadmin credentials. The server never gets a public address; the browser session rides through Bastion over HTTPS.

Why you'd do this

Azure Bastion is a managed jump host. It sits inside your virtual network with its own public IP, and when you connect, the portal opens an HTML5 RDP or SSH session tunneled over port 443 to a VM that has no public address at all. That is the whole reason this project deployed the server without a public IP in lab 3: Bastion is the door, and the server never has to be reachable from the internet to be manageable.

The subnet is the step people get wrong. Bastion requires a subnet named exactly AzureBastionSubnet, at least /26 in size, and you'll see the portal lock the name field the moment you pick Azure Bastion as the subnet purpose. Lab 2 left 10.10.0.0/26 open for precisely this, so the 64 addresses are already waiting. As with the server subnet, you'll uncheck Enable private subnet so the Bastion hosts keep their default outbound path, and leave the NSG at None, because Bastion ships with the network rules it needs.

On the Bastion form, Basic tier is enough for a browser session to one VM; the instance count is fixed at 2 and greyed out, which is Bastion's built-in redundancy. Standard and Premium add native-client RDP, file transfer, IP-based connections, and scaling, and they cost accordingly. The public IP has to be Standard SKU and Static, and choosing Zone-redundant for it means the entry point survives a single-zone outage in East US 2. Bastion is billed by the hour from the moment it deploys, so in production this is the resource you size deliberately and never leave running by accident.

When you connect, Bastion opens the desktop in a new browser tab, so expect to allow the pop-up once. The session works because of lab 4: the Allow-RDP-From-VNet rule on snet-servers permits TCP 3389 from inside the virtual network, and Bastion's connection arrives from inside the virtual network. Bastion, its subnet requirements, and connecting to private VMs are all tested on AZ-104, and the public-IP-free pattern is one AZ-900 expects you to recognize as the secure default.

Lab details

  • Bastion subnet: AzureBastionSubnet · 10.10.0.0/26 (64 addresses) on vnet-surfcity · private subnet unchecked · NSG and NAT gateway: None
  • Bastion host: bas-surfcity in rg-surfcity-infra · Region: (US) East US 2 · Tier: Basic · Instance count: 2 (fixed)
  • Public IP: pip-bas-surfcity · SKU Standard · IPv4 · Static · Tier Regional · Zone-redundant
  • Connection: vm-surfcity-01 → Connect → Connect via Bastion · Authentication: VM Password · surfadmin / P@ssw0rd!123
  • Result: Windows Server desktop opens in a new browser tab over HTTPS; the VM still has no public IP

Learning objectives

  1. Add a purpose-built AzureBastionSubnet of the required size to an existing virtual network.
  2. Deploy an Azure Bastion host and choose an appropriate tier.
  3. Create a Standard, static, zone-redundant public IP for Bastion.
  4. Connect to a VM with no public IP through Bastion using password authentication.
  5. Explain how Bastion, the NSG rule from lab 4, and a private VM fit together.

Exam relevance

  • AZ-900 — Microsoft Azure Fundamentals — Azure Bastion, secure remote access, public IP SKUs, availability zones.
  • AZ-104 — Microsoft Azure Administrator — configure Azure Bastion, AzureBastionSubnet requirements, connect to VMs without public IPs, public IP address configuration.

Where this lab fits in the project

Everything before this lab was building toward a server nobody could reach: lab 3 deployed vm-surfcity-01 with no public IP, and lab 4 limited RDP to traffic from inside the virtual network. This lab provides the way in. The 10.10.0.0/26 range you reserved in lab 2 becomes the Bastion subnet, and the RDP-from-VNet rule is what lets the Bastion session reach the server.

In lab 6 you'll open the same Bastion session again to mount the Surf City file share as the Z: drive on the server.

Step-by-step instructions

  1. Create the Bastion subnet:
    • In the search box at the top of the portal, type vnet-surfcity and select it under Resources.
    • Under Settings, select Subnets, then + Subnet.
    • In the Subnet purpose dropdown, select Azure Bastion; confirm the Name shows AzureBastionSubnet and is not editable.
    • Confirm the Starting address is 10.10.0.0, the Size is /26 (64 addresses), and the range shows 10.10.0.0 - 10.10.0.63.
    • Under Private subnet, uncheck Enable private subnet (no default outbound access); leave NAT gateway and Network security group set to None.
    • Select Add and confirm AzureBastionSubnet is listed with address range 10.10.0.0/26 alongside snet-servers.
  2. Open the Bastions service:
    • In the search box at the top of the portal, type Bastions and select it under Services.
    • Select + Create.
  3. Configure instance details:
    • Confirm the Surf City Boats subscription is selected and choose resource group rg-surfcity-infra.
    • In the Name field, type bas-surfcity and select region (US) East US 2.
    • Confirm the Availability zone dropdown shows None.
    • Under Tier, select Basic, and confirm Instance count shows 2 and is not editable.
  4. Configure the virtual network:
    • In the Virtual network dropdown, select vnet-surfcity.
    • Confirm the Subnet field automatically shows AzureBastionSubnet (10.10.0.0/26).
  5. Configure the public IP address:
    • Under Public IP address, select Create new and name it pip-bas-surfcity.
    • Confirm the SKU shows Standard, the IP version shows IPv4, the assignment shows Static, and the Tier shows Regional.
    • In the Availability zone dropdown, select Zone-redundant, then select OK.
  6. Create the Bastion host:
    • Select Review + create and confirm Validation passed is displayed.
    • Confirm the Tier shows Basic, the Virtual network shows vnet-surfcity, and the Subnet shows AzureBastionSubnet.
    • Select Create and wait for the deployment to complete.
  7. Connect to the VM through Bastion:
    • In the search box at the top of the portal, type vm-surfcity-01 and select it under Resources.
    • On the Overview page, select Connect, then Connect via Bastion.
    • Confirm the Authentication Type is VM Password; enter username surfadmin and password P@ssw0rd!123.
    • Confirm Open in new browser tab is checked and select Connect; if the browser blocks the pop-up, allow pop-ups for the portal and select Connect again.
    • Confirm the Windows Server desktop opens in a new browser tab, then close the Bastion tab and return to the Azure portal.

Launch the lab simulation — free with a labITpro account; no Azure subscription required.

An Introduction to Microsoft Entra ID

Learn what you need to know to get started with Microsoft Entra ID with this easily-digestible 5-hour bootcamp from best-selling instructor, Thomas Mitchell.

Disable these ads by becoming a labITpro Supporter!

Azure vNets Explained

Want to learn about Azure virtual networks? In this quick-hitting explanation, you’ll learn what they are, what they do, and you’ll learn about key Azure vNet features.

Disable these ads by becoming a labITpro Supporter!