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) onvnet-surfcity· private subnet unchecked · NSG and NAT gateway: None - Bastion host:
bas-surfcityinrg-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
- Add a purpose-built AzureBastionSubnet of the required size to an existing virtual network.
- Deploy an Azure Bastion host and choose an appropriate tier.
- Create a Standard, static, zone-redundant public IP for Bastion.
- Connect to a VM with no public IP through Bastion using password authentication.
- 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
- Create the Bastion subnet:
- In the search box at the top of the portal, type
vnet-surfcityand select it under Resources. - Under Settings, select Subnets, then + Subnet.
- In the Subnet purpose dropdown, select Azure Bastion; confirm the Name shows
AzureBastionSubnetand is not editable. - Confirm the Starting address is
10.10.0.0, the Size is /26 (64 addresses), and the range shows10.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
AzureBastionSubnetis listed with address range10.10.0.0/26alongsidesnet-servers.
- In the search box at the top of the portal, type
- Open the Bastions service:
- In the search box at the top of the portal, type
Bastionsand select it under Services. - Select + Create.
- In the search box at the top of the portal, type
- Configure instance details:
- Confirm the Surf City Boats subscription is selected and choose resource group
rg-surfcity-infra. - In the Name field, type
bas-surfcityand 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.
- Confirm the Surf City Boats subscription is selected and choose resource group
- Configure the virtual network:
- In the Virtual network dropdown, select
vnet-surfcity. - Confirm the Subnet field automatically shows
AzureBastionSubnet (10.10.0.0/26).
- In the Virtual network dropdown, select
- 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.
- Under Public IP address, select Create new and name it
- 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 showsAzureBastionSubnet. - Select Create and wait for the deployment to complete.
- Connect to the VM through Bastion:
- In the search box at the top of the portal, type
vm-surfcity-01and select it under Resources. - On the Overview page, select Connect, then Connect via Bastion.
- Confirm the Authentication Type is VM Password; enter username
surfadminand passwordP@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.
- In the search box at the top of the portal, type
Launch the lab simulation — free with a labITpro account; no Azure subscription required.