Networking · Lesson 18 of 24

Bastion, endpoints and VPN

Logging on to servers without exposing them, reaching Azure services privately, and the two ways the office connects in.

About 10 min · Interactive · 3 practice questions

Exam objective
Implement Azure Bastion · Configure service endpoints for Azure PaaS · Configure private endpoints for Azure PaaSImplement and manage virtual networking · 15–20% of the exam · typical question: "Admins must connect without a public IP", "service must not be reachable from the internet", DNS not resolving to the private IP
In one sentence. Three different "private access" problems. Bastion: how an admin reaches a server's desktop without opening it to the internet. Endpoints: how servers reach a storage account or database without the traffic going over the public internet. VPN and ExpressRoute: how the whole office network plugs into the Azure network.

Azure Bastion

Admin browserportal, HTTPS 443Bastion hostAzureBastionSubnet /26VM1 · private IP onlyVM in a peered VNetRDP/SSH
The VM never gets a public IP. The session opens in a browser tab.

You, the admin: deploy Bastion once per VNet

  1. VNet1 › Subnets › + Subnet, name exactly AzureBastionSubnet, size /26 or larger.
  2. Bastions › + Create: VNet1, SKU Basic (Standard adds native RDP client, file copy and scaling; Premium adds session recording; Developer is a free limited tier), new Standard public IP.
  3. About 10 minutes later: VM › Connect › Bastion, enter the VM's credentials, the desktop opens in the browser. Works for VMs in VNet1 and in VNets peered to it.

Service endpoints vs private endpoints

Option 1 · Service endpoint: a trusted shortcut, service keeps its public address
Subnet App10.1.1.0/24
→never touches the open internet
Microsoft backbonetraffic tagged with the subnet identity
→firewall checks the tag
Storage accountstill has public IP 20.x.x.x; firewall allows only this subnet
Cheap and simple
  • Free
  • One tick box on the subnet, one line in the storage firewall
  • No DNS changes
  • Does NOT work from the office over VPN
  • Service is still visible on the internet, just locked
Option 2 · Private endpoint: the service gets a private address inside your network
Subnet App10.1.1.0/24
→private IP, needs private DNS zone
Private endpoint NIC10.1.1.9, lives in your subnet
→Private Link
Storage accountpublic access switched OFF
Fully private
  • Works from the office over VPN or ExpressRoute
  • Public access can be disabled completely
  • One endpoint per service instance
  • Costs per hour plus data
  • Needs the privatelink DNS zone linked to the VNet
Which is better?

"Only from this subnet, lowest cost" = service endpoint. "Must not be reachable from the internet at all" or "also from on-premises" = private endpoint.

You, the admin: storage reachable only from VNet1 and from the office

  1. Storage account › Networking › Private endpoint connections › + Private endpoint. Target sub-resource blob, VNet1 / subnet Data.
  2. On the DNS tab keep Integrate with private DNS zone = Yes; Azure creates privatelink.blob.core.windows.net, links it to VNet1 and adds the A record for the NIC's IP 10.10.2.9.
  3. Back on Networking › Firewalls and virtual networks set public access to Disabled.
  4. From a VM, nslookup contosoinvoices01.blob.core.windows.net must now answer 10.10.2.9. If it still shows a public IP, the DNS zone is not linked to that VNet. The office reaches it over the VPN because it is just a private IP.

A service endpoint is simpler: on VNet1 › Subnets › Data tick Microsoft.Storage under Service endpoints, then add that subnet in the storage firewall. Free, no DNS changes, but the service keeps its public address and the office cannot use the path.

VPN and ExpressRoute (lightly tested)

OptionWhat it isWhat you create
Site-to-site VPNEncrypted tunnel over the internet from your office routerGatewaySubnet (/27); a virtual network gateway (type VPN, SKU sets speed, 30 to 45 min to build; Basic has no BGP); a local network gateway holding the office public IP and address ranges; a connection with a shared key
Point-to-siteOne laptop at a timeSame gateway plus a client address pool; auth by certificate, Entra ID or RADIUS
VNet-to-VNetTunnel between two VNetsWhen peering is not possible (rare)
ExpressRouteA private leased line through a carrier, not the internetCircuit from the provider + ExpressRoute gateway
Trap wording. "Admins must RDP without a public IP" = Bastion in AzureBastionSubnet. "Not reachable from the internet" or "also from on-prem" = private endpoint + private DNS zone. "Only from this subnet, lowest cost" = service endpoint. "Still resolves to a public IP" = link the private DNS zone.

Key points

  • Bastion = admin access without a public IP; AzureBastionSubnet /26 and a Standard public IP.
  • Service endpoint: free, per subnet, service keeps its public address, not from on-prem.
  • Private endpoint: a private IP for one service instance, works from on-prem, needs the privatelink DNS zone linked to the VNet.
  • Site-to-site VPN needs GatewaySubnet, a virtual network gateway and a local network gateway; takes 30 to 45 minutes to build.

Formal terms: Azure Bastion, Private Link / private endpoint, service endpoint, private DNS zone, virtual network gateway, local network gateway, IPsec/IKE, ExpressRoute.

Check your understanding

3 exam-style questions in the formats AZ-104 uses. Each is marked when you check it, with the reasoning.

0 of 3 checked

All scenarios and questions are original. None are taken from the exam, Microsoft's practice assessment or any question bank. PrepToExcel is not affiliated with Microsoft.