4.3AZ-104Intermediate
Est: ~15 mins•Verified: 2026-08
Azure Load Balancer, Application Gateway & Private DNS Zones
Design high-availability network traffic routing using Layer 4 Azure Load Balancer, Layer 7 Azure Application Gateway with SSL termination & URL routing, and configure internal name resolution via Azure Private DNS Zones.
Tags:#Azure#Networking#Load Balancer#Application Gateway#Private DNS#Layer 7#AZ-104
01
Overview
Azure provides dedicated load-balancing services catering to different layers of the OSI model:
- Azure Load Balancer (Layer 4 - Transport):
- High-throughput, ultra-low latency routing for TCP and UDP traffic.
- Evaluates a 5-tuple hash:
Source IP,Source Port,Destination IP,Destination Port, andProtocol. - Supports Public (internet-facing) and Internal (private IP) configurations on Standard SKU.
- Azure Application Gateway (Layer 7 - Application):
- Web-traffic load balancer capable of routing decisions based on HTTP/HTTPS attributes (e.g., URL path
/images/vs/api/, host headers). - Features: SSL/TLS termination, Cookie-based session affinity, Web Application Firewall (WAF v2), and URL redirection.
- Azure Private DNS Zones:
- Provides internal name resolution within and between VNets without needing custom DNS VMs (
privatelinkand custom split-brain domains). - Supports Auto-registration of VMs deployed within linked VNets.
---
02
When to Use: Load Balancer vs Application Gateway
| Feature | Azure Load Balancer (L4) | Azure Application Gateway (L7) |
|---|---|---|
| OSI Layer | Layer 4 (TCP / UDP). | Layer 7 (HTTP / HTTPS / HTTP/2). |
| Routing Decisions | IP address and port (5-tuple / 2-tuple). | URL path, host header, cookie session affinity. |
| SSL/TLS Termination | No (passes encrypted packets directly to backend). | Yes (decrypts SSL at gateway; re-encrypts or routes plain HTTP). |
| Web Application Firewall | Not supported (requires Azure Firewall or NVA). | Integrated WAF v2 (OWASP Core Rule Set 3.2+). |
| Public & Private IPs | Supported on Standard SKU. | Supported on v2 SKU (frontend can have both public and private IP). |
---
03
Prerequisites
Administrator Permissions:
- Network Contributor on the target resource group and virtual network.
- Dedicated empty subnet with at least
/27address space for Azure Application Gateway v2 (cannot be shared with VMs).
---
04
Portal Path
TEXT
Azure Portal (https://portal.azure.com)
├── Load balancers > [Your Load Balancer]
│ ├── Frontend IP configuration (Public / Private IP)
│ ├── Backend pools (Add NICs or VMSS instances)
│ ├── Health probes (TCP / HTTP probe on port 80/443)
│ └── Load balancing rules (Bind Frontend + Backend + Probe)
├── Application gateways > [Your App Gateway]
│ ├── Listeners (HTTP 80 / HTTPS 443 with SSL Certificate)
│ ├── Backend pools (VMs, App Services, or FQDNs)
│ └── Routing rules (Path-based routing / images/* to Pool A)
└── Private DNS zones > [e.g. contoso.internal]
├── Virtual network links (Link to VNet with Auto-registration enabled)
└── Recordsets (Add A, CNAME, TXT records)---
05
Step-by-Step Implementation
Step 1: Deploy a Standard Azure Load Balancer
- Navigate to Load balancers > click + Create.
- Type: Public or Internal.
- SKU: Standard (Zone-redundant).
- Configure Frontend IP: Allocate a Standard Public IP address.
- In Backend pools: Add the NICs of your web servers.
- In Health probes: Name
hp-http-80, ProtocolTCP, Port80, Interval5s, Unhealthy threshold2. - In Load balancing rules: Name
lb-rule-http, Frontend IP, Backend pool, Health probe, Port 80 to Port 80, Session persistence: None or Client IP.
Step 2: Deploy Azure Application Gateway with Path-Based Routing
- Create a dedicated subnet:
snet-appgw(e.g.,10.0.10.0/24) in your VNet. - Navigate to Application gateways > click + Create.
- SKU: Standard v2 or WAF v2.
- Configure Frontends: Assign Standard Public IP.
- Define Backend pools:
pool-default: Main web servers.pool-images: Image storage or media VMs.
- Configure Routing Rules:
- Rule type: Path-based.
- Path
/images/*-> routes topool-images. - Default path
/*-> routes topool-default.
Step 3: Configure Azure Private DNS Zone
- Search Private DNS zones > click + Create.
- Name:
corp.internal - Under Virtual network links, click + Add:
- Link name:
link-vnet-prod - Virtual network: Select
vnet-production - Check Enable auto registration (automatically creates A records for VMs).
---
06
Azure PowerShell & Azure CLI
PowerShell: Deploy Azure Standard Internal Load Balancer
PowerShell
# Connect and set subscription
Connect-AzAccount
Set-AzContext -SubscriptionId "<YOUR-SUBSCRIPTION-ID>"
$rgName = "rg-network-core"
$location = "westeurope"
$vnetName = "vnet-prod"
$subnetName = "snet-backend"
# 1. Retrieve VNet and Subnet
$vnet = Get-AzVirtualNetwork -Name $vnetName -ResourceGroupName $rgName
$subnet = Get-AzVirtualNetworkSubnetConfig -Name $subnetName -VirtualNetwork $vnet
# 2. Configure Frontend IP, Backend Pool, and Health Probe
$frontendIP = New-AzLoadBalancerFrontendIpConfig `
-Name "ilb-frontend" `
-PrivateIpAddress "10.0.2.50" `
-SubnetId $subnet.Id
$backendPool = New-AzLoadBalancerBackendAddressPoolConfig -Name "ilb-backend-pool"
$probe = New-AzLoadBalancerProbeConfig -Name "ilb-tcp-probe" -Protocol "Tcp" -Port 80 -IntervalInSeconds 5 -ProbeCount 2
# 3. Create Load Balancing Rule
$lbRule = New-AzLoadBalancerRuleConfig `
-Name "ilb-rule-80" `
-FrontendIpConfiguration $frontendIP `
-BackendAddressPool $backendPool `
-Probe $probe `
-Protocol "Tcp" `
-FrontendPort 80 `
-BackendPort 80 `
-IdleTimeoutInMinutes 15
# 4. Deploy Load Balancer
$ilb = New-AzLoadBalancer `
-ResourceGroupName $rgName `
-Name "ilb-internal-app" `
-Location $location `
-Sku "Standard" `
-FrontendIpConfiguration $frontendIP `
-BackendAddressPool $backendPool `
-Probe $probe `
-LoadBalancingRule $lbRule
Write-Host "Internal Load Balancer deployed: $($ilb.Name)" -ForegroundColor Green---
07
Verification Checklist
VERIFICATION CHECKLIST
0/5 (0%)
Azure Load Balancer distributes requests evenly across backend VMs.
Shutting down one backend VM triggers health probe failure within 10 seconds and stops traffic forwarding.
Application Gateway path /images/logo.png routes exclusively to pool-images.
Private DNS zone automatically creates A records for newly provisioned virtual machines.
NSG on backend subnet allows incoming traffic from Azure Load Balancer health probe service tag (AzureLoadBalancer).
08
Common Pitfalls & Troubleshooting Matrix
| Issue | Root Cause | Resolution |
|---|---|---|
| All backend VMs show unhealthy in Load Balancer | NSG is blocking the Azure Load Balancer health probe. | Allow inbound traffic from Service Tag AzureLoadBalancer on probe port (e.g. 80). |
| Application Gateway subnet deployment error | Subnet contains existing NICs or has a subnet size smaller than /27. | Application Gateway requires a dedicated, empty subnet of minimum /27 CIDR. |
| Private DNS name not resolving from peered VNet | The Private DNS Zone is only linked to the primary VNet. | Add a Virtual Network Link for each peered VNet needing name resolution. |
| Session drops during shopping cart checkout | Load Balancer default distribution is 5-tuple (no affinity). | Change session persistence to Client IP (2-tuple) or use Application Gateway cookie affinity. |
---
09
Real-World Architecture / Flow
Interactive Topology & Workflow
Internet Client (HTTPS 443)client
Flow & Verification Handshake
Backend Pool Acompute
App VMs ] [ Backend Pool B - Storage / Blob
---
10
Audit & Monitoring
- Enable Application Gateway Access Logs (
ApplicationGatewayAccessLog) and Performance Logs. - Monitor Load Balancer Health Probe Status:
- Metric:
DipAvailability(Data Path Availability) - alert when< 100%.
---
11
Rollback & Emergency Recovery
- Bypass Failed Backend Instance:
- Remove the unhealthy NIC from the Load Balancer backend pool to isolate the server for forensics.
- Failover DNS Resolution:
- Update Azure Private DNS Zone
Arecord pointing to secondary disaster recovery IP endpoint.
---
12
Official Documentation Reference
13
Exam Blueprint & Pro Tips (AZ-104)
Exam Blueprint & High-Yield Traps
AZ-104 High-Yield Rules:
- Dedicated Subnet: Azure Application Gateway requires a dedicated subnet with no other resources. Minimum subnet size is
/27(/26or/24recommended). - AzureLoadBalancer Service Tag: Health probes originate from virtual IP
168.63.129.16. Never block this IP or theAzureLoadBalancerservice tag in NSGs. - L4 vs L7 Decision: If question mentions "SSL termination", "URL path routing", or "cookie affinity", the answer is Application Gateway. If it mentions "UDP", "high-throughput port forwarding", or "non-HTTP protocols", the answer is Azure Load Balancer.
- Private DNS Auto-Registration: A Private DNS zone supports auto-registration on up to 100 linked VNets, but an individual VNet can only be linked for auto-registration to one private zone.