Your profile

One profile for every MSDEVBUILD site. Only you can see it, and the site owner if you write in.

Lesson 39 of 47
❮Prev Next❯

Configure and Troubleshoot Azure Load Balancer

Module 4: Networking ⏱ 12 min read Updated

Your note

My notes for this lesson

Select any text in the lesson to highlight it or add a note. Saved in this browser.

    No highlights yet. Select a sentence in the lesson, then pick a colour or add a note.

    All my bookmarks and notes

    Reading settings

    For every lesson, saved in this browser.

    Text size
    Line spacing
    Font

    With IaaS you rent the virtual machine. Microsoft looks after the building, power and hardware; you patch the operating system.

    30-second answer

    Azure Load Balancer spreads TCP and UDP flows (layer 4) from a frontend IP to a backend pool of VMs or scale set instances. A public load balancer uses a Standard public IP; an internal one uses a private IP in a subnet. A load-balancing rule maps a frontend port to a backend port and uses a health probe (TCP, HTTP or HTTPS) to send new flows only to healthy instances. Use the Standard SKU (Basic was retired on 30 September 2025): it's zone-redundant, needs backends in one VNet, and is secure by default, so an NSG must allow the traffic. Probes come from 168.63.129.16 (the AzureLoadBalancer tag); blocking it marks backends Down.

    Simulate it » No Azure account needed

    Exam objective: 4.3.2 Configure an internal or public load balancer. 4.3.3 Troubleshoot load balancing. (Skills measured as of April 17, 2026)

    Simulations

    Feel it before you read it. No account needed, nothing leaves this page.

    Azure portal: Create a Standard public load balancer and fix a failing backend Create a Standard load balancer and fix an unhealthy backend.
    </> Embed

    Embed this simulation

    Free for trainers, teachers and bloggers. Paste this into your page:

    Loading the portal…

    Search for <strong>load balancers</strong>.

    👆 Click the glowing item in the portal to continue

    Read the steps as text
    1. Search for load balancers.
    2. Type load balancers in the search bar and pick Load balancers under Services.
    3. Public gives the frontend a public IP. Internal uses a private IP in a subnet, for tiers only the VNet should reach.
    4. Add a frontend that uses the Standard public IP pip-lb.
    5. The pool holds VMs from one VNet, by NIC or by IP address.
    6. A rule maps frontend port 80 to backend port 80 and uses an HTTP probe on /health. Only a 200 counts as healthy.
    7. Review and Create.
    8. Customers say pages are slow. Backend pools shows vm-web02 is unhealthy, so it gets no new flows.
    9. On web02's NIC the effective rules show a Deny-LB rule blocking the probe. Delete it (or never write it).
    10. After the fix, Insights shows health probe status back at 100%. The Health Probe Status and Data Path Availability metrics are the first place to look next time.

    🧪 Simulation for learning. Screens are simplified versions of the Azure portal; names, prices and IDs are examples. Nothing here touches real Azure.

    😟 THE PROBLEM

    One web server crashes and a third of customers get errors until someone notices.

    😊 THE SOLUTION

    Put the servers behind a Standard load balancer with a health probe.

    • Dead server keeps getting traffic✓ Health probe takes it out
    • Probe blocked by an NSG✓ Allow the AzureLoadBalancer tag
    • Database tier exposed✓ Internal frontend
    🛠️ Solved with: Azure Load Balancer

    Start with a question

    How does a busy café keep the queue moving when one barista goes on break?

    The manager points each new customer to a free barista. Every few minutes she glances along the counter, and if someone has stepped away, she stops sending customers to that spot until they’re back.

    An Azure Load Balancer is the manager. It hands each new connection to a VM in the backend pool, and a health probe is her glance along the counter. A VM that stops answering gets no new customers until it recovers.

    Explain it like I’m 10

    The technical explanation

    The parts

    PartWhat you set
    Frontend IPPublic (a Standard public IP, zone-redundant) or internal (a private IP in a subnet)
    Backend poolVMs or scale set instances by NIC or by IP address, all in one VNet
    Health probeProtocol TCP, HTTP or HTTPS, port, path (HTTP/S), interval (default 5 seconds)
    Load-balancing ruleFrontend IP + port → backend pool + port, probe, session persistence, idle timeout, floating IP, TCP reset
    Inbound NAT ruleOne frontend port → one VM (for example 50001 → VM1:22)
    Outbound ruleSNAT for outbound internet from the pool (public load balancer)

    Distribution: None (5-tuple hash of source IP, source port, destination IP, destination port, protocol), Client IP (2-tuple) or Client IP and protocol (3-tuple). HA ports (all ports, all protocols) exist on internal Standard load balancers for NVAs.

    Standard SKU behaviour

    • Secure by default: backends get no inbound traffic unless an NSG on the subnet or NIC allows it.
    • Zone-redundant frontends, 99.99% SLA, HTTPS probes, up to 1,000 backend instances.
    • Backends must be in one virtual network.
    • Basic was retired on 30 September 2025, so new deployments are Standard (or Gateway for chaining NVAs).

    Price feel: about $0.025 an hour for the first 5 rules plus a small charge per GB processed (illustrative).

    Public vs internal

    Public load balancer

    • Frontend: Standard public IP
    • Clients: anywhere on the internet
    • Typical tier: web
    • Can provide outbound SNAT

    Internal load balancer

    • Frontend: private IP in a subnet
    • Clients: VNet, peered VNets, on-premises
    • Typical tier: app, database, NVA (HA ports)
    • No internet exposure
    Same load balancer, two kinds of frontend

    Troubleshooting

    SymptomLikely causeCheck
    One backend never gets trafficProbe fails on that VMProbe port/path, app listening, NSG blocking AzureLoadBalancer / 168.63.129.16, guest firewall
    All backends DownProbe misconfiguredWrong port, HTTP path returns 404 or 301
    Probes healthy, clients time outNSG doesn’t allow client trafficEffective security rules on the backend NIC (Standard is secure by default)
    Backend VM can’t reach the internal frontendFlow hashed back to itselfNot supported; call the other tier directly
    Uneven distributionFew clients behind one NATExpected with hashing; review session persistence

    Use Load balancer → Insights and the metrics Health Probe Status (DipAvailability) and Data Path Availability (VipAvailability), plus Network Watcher on the backend VMs.

    Portal and CLI

    Portal: Load balancers → + Create: Basics (SKU Standard, Type Public or Internal, Tier Regional) → Frontend IP configuration → Backend pools → Inbound rules (rule + new health probe) → Review + create.

    az network public-ip create -g rg-net-lb -n pip-lb --sku Standard --allocation-method Static
    az network lb create -g rg-net-lb -n lb-web --sku Standard --public-ip-address pip-lb \
      --frontend-ip-name fe-web --backend-pool-name bepool-web
    az network lb probe create -g rg-net-lb --lb-name lb-web -n probe-http --protocol Http --port 80 --path /health
    az network lb rule create -g rg-net-lb --lb-name lb-web -n rule-http --protocol Tcp \
      --frontend-port 80 --backend-port 80 --frontend-ip-name fe-web --backend-pool-name bepool-web --probe-name probe-http
    az network nic ip-config address-pool add -g rg-net-lb --nic-name nic-web01 --ip-config-name ipconfig1 \
      --lb-name lb-web --address-pool bepool-web
    # Internal instead: az network lb create ... --vnet-name vnet-web --subnet snet-app --private-ip-address 10.40.2.10

    PowerShell: New-AzLoadBalancerFrontendIpConfig, New-AzLoadBalancerBackendAddressPoolConfig, New-AzLoadBalancerProbeConfig, New-AzLoadBalancerRuleConfig, New-AzLoadBalancer -Sku Standard.

    Architect level Floating IP and HA ports

    Floating IP (direct server return) keeps the frontend IP as the destination when the packet reaches the VM, which SQL Server Always On listeners need. HA ports on an internal Standard load balancer balance every port and protocol with one rule, which is how you put a pair of firewall NVAs behind one internal frontend and point UDRs at it.

    Real-world business scenario

    Education

    Proseware Learning (fictional)

    The problem
    Exam-day traffic overloaded the single web VM, and when the team added a second VM behind a load balancer, it never received traffic.
    What they used
    A Standard public load balancer with an HTTP probe on /health, two then four web VMs across zones in one backend pool, and an internal load balancer in front of the API tier. Effective security rules showed a hardened NSG denying the AzureLoadBalancer tag on the new VM, which was removed.
    Why that choice
    The probe can now reach every VM, so traffic spreads across all healthy ones and a failed VM drops out on its own.
    The result
    Exam-day traffic was shared across four VMs with no outage, and a VM that crashed mid-morning was taken out of rotation within seconds.

    When to use it and when not to

    ✓ Use it when…

    • Spreading TCP or UDP traffic over VMs or scale set instances.
    • An internal frontend for app, database or NVA tiers.
    • High availability across zones with health probes doing the failover.

    ✕ Think twice when…

    • URL-based routing, TLS termination or WAF. Use Application Gateway.
    • Global routing across regions by latency. Use Front Door or Traffic Manager.
    • Backends with no NSG allowing the traffic on a Standard load balancer.

    ↔ Alternatives to consider

    • Azure Application Gateway for layer 7 routing and WAF.
    • Azure Front Door for global HTTP(S) load balancing and acceleration.
    • Cross-region (global tier) Load Balancer for layer 4 across regions.
    Ready for more?The full lesson adds the technical explanation, when to use it, interview questions and revision notes.

    Test yourself with exercises

    5 original practice questions in the AZ-104 style. Pick your answers, then check them. You will see why each option is right or wrong. Score 75% or more and this topic is marked complete.

    Question 1

    Question 1 of 5

    You need to distribute TCP 1433 traffic from application servers to three database VMs. The database endpoint must not be reachable from the internet. What should you deploy?

    Question 2

    Question 2 of 5

    A Standard load balancer marks VM2 in the backend pool as unhealthy. The web application on VM2 works when tested locally. An NSG on the NIC of VM2 contains a deny rule. Which traffic is the deny rule most likely blocking?

    Question 3

    Question 3 of 5

    A Standard public load balancer has a load-balancing rule for TCP 80, a healthy HTTP probe and two backend VMs. Neither the VM network interfaces nor their subnet has an NSG. Clients cannot connect. What should you do?

    Question 4

    Question 4 of 5

    Users of a web application must be sent to the same backend VM for every request from the same client IP address. Which load-balancing rule setting should you configure?

    Question 5

    Question 5 of 5 · Select 2

    An HTTP health probe is configured for port 80 and the path /status. Every backend VM is marked unhealthy. The web server on each VM listens on port 80 and returns HTTP 404 for /status. Which two actions would resolve the issue? Each correct answer presents a complete solution.

    Interview preparation

    Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.

    Beginner What's the difference between a public and an internal load balancer?

    Model answer

    A public load balancer has a public IP frontend, so internet clients can reach it, typically for a web tier. An internal one has a private IP frontend inside a subnet, so only the VNet, peered VNets and on-premises can reach it, which suits app or database tiers.

    Intermediate One backend VM is marked unhealthy, but the app works when you browse to it directly. What do you check?

    Model answer

    What the probe does. Is the probe port the port the app listens on, and for HTTP, does the path return 200? Then the NSGs on that VM's subnet and NIC: a rule that blocks the AzureLoadBalancer tag, or 168.63.129.16, makes the probe fail even though users could connect. I'd look at the Health Probe Status metric and the effective security rules.

    Experienced developer What changed when Basic Load Balancer was retired?

    Model answer

    Everything is Standard now. Standard is secure by default, so backends need an NSG that allows traffic. It supports availability zones, a 99.99% SLA, HTTPS probes, outbound rules and backends of any VM in one VNet, not just an availability set. And it needs Standard public IPs.

    Scenario A VM in the backend pool calls the internal load balancer's frontend IP and the call times out. Why?

    Model answer

    If the flow gets hashed back to the same VM, it fails, because an internal load balancer doesn't support a backend sending traffic to its own frontend and landing on itself. The usual fix is to have the app call the other tier directly or put the client in a different pool.

    Quick revision

    Key points

    • Layer 4 (TCP/UDP). Frontend, backend pool, health probe, load-balancing rule.
    • Public frontend = Standard public IP. Internal frontend = private IP in a subnet.
    • Standard only (Basic retired 30 September 2025). Zone-redundant, one VNet per pool, secure by default.
    • Probes come from 168.63.129.16. Don't block the AzureLoadBalancer tag.
    • Default distribution is a 5-tuple hash. Client IP persistence keeps a client on one VM.

    Important terminology

    Frontend IP configuration
    The IP address clients connect to. A Standard public IP for a public load balancer, or a private IP in a subnet for an internal one.
    Backend pool
    The VMs or scale set instances, by NIC or by IP address in one VNet, that receive the traffic.
    Health probe
    A regular TCP, HTTP or HTTPS check of each backend. HTTP and HTTPS need a 200 response to count as healthy.
    Load-balancing rule
    Maps a frontend IP and port to a backend pool and port, with a probe, distribution mode and options such as floating IP.
    Session persistence
    Distribution mode. None (5-tuple hash, default), Client IP (2-tuple) or Client IP and protocol (3-tuple).
    Inbound NAT rule
    Forwards one frontend port to one backend instance, for example port 50001 to VM1 port 22.

    Common mistakes

    • No NSG on a Standard load balancer's backends, so nothing gets in.
    • HTTP probe pointing at a path that returns 404 or a redirect.
    • Using Load Balancer when URL routing or a WAF is needed (Application Gateway).

    Exam tips

    • "Distribute TCP traffic across VMs, keep the database tier private" = internal load balancer.
    • "Backend marked unhealthy" = check the probe port/path and NSG rules for AzureLoadBalancer.
    • "Same client must reach the same VM" = session persistence Client IP.

    Five quick revision questions

    1. 1.At which OSI layer does Azure Load Balancer work?Show

      Layer 4 (TCP and UDP).

    2. 2.Which IP do health probes come from?Show

      168.63.129.16.

    3. 3.What response does an HTTP probe need?Show

      HTTP 200.

    4. 4.What is the default distribution mode?Show

      5-tuple hash (session persistence None).

    5. 5.Which metric shows probe results?Show

      Health Probe Status (DipAvailability).

    Official references

    Finished this lesson? Tick it off. Your progress is saved in this browser.

    Next up: Troubleshoot Virtual Network Connectivity

    Studying with a friend? Send them this lesson

    It's free and needs no sign-up. Their progress saves in their own browser.

    Lesson done? Make it stick with a quick gameSort It, Match the Pairs, Lightning Round and Who Am I? Earn XP and badges. Play ❯

    Install MSDEVBUILD Azure

    Free · no account · works offline

    Save the whole course for offline ›

    Hi, I’m your Nimbus

    Your study buddy. Pick what we do next.

    MSDEVBUILD · Multi-Stack Dev Build

    Sign in to MSDEVBUILD

    One account for Azure certifications and the blog: sign in here and you are signed in on both. Your XP, streak, practice deck and certificate stay in sync on every device. Optional: everything works without an account.