Practice Exams:

Microsoft AZ-104: Load Balancer vs. App Gateway

Cloud & Architecture

Azure Load Balancer and Application Gateway solve different routing problems. The choice turns on transport versus HTTP awareness, required security features, health behavior, and where traffic enters the workload. A regional layer-seven entry point and a transport-level load balancer do different work. Compare protocol support, TLS handling, health evaluation, network placement, and failure behavior before deciding where application traffic should first be received. A choice that fits the protocol but ignores TLS, backend health, or traffic inspection can introduce operational blind spots after deployment.

On this page
  1. Describe the traffic before selecting the service
  2. Azure Load Balancer operates at the transport layer
  3. Application Gateway understands HTTP requests
  4. Health probes must represent actual service readiness
  5. Review public exposure, WAF and TLS ownership
  6. Compare operational complexity and regional scope
  7. Diagnose a failed request through the chosen layer
  8. Choose from the request path, then test the choice

Describe the traffic before selecting the service

A service can be reachable by an IP address and port without understanding HTTP at all. Another service must direct requests to different backends based on hostname, URL path, cookies or TLS configuration. These are different routing needs, so choosing a load-balancing product from its name alone is unreliable. A Microsoft AZ-104 traffic design should distinguish Layer 4 load balancing from Layer 7 routing, inspection, and TLS requirements.

Start with the client protocol, entry point, destination and desired routing decision. Does the application accept raw TCP, UDP or supported transport traffic? Does it need HTTP-aware routing and a web application firewall? Is the frontend private, public or both? Does traffic stay inside a region or require a global routing layer? Each answer narrows the architecture before the product list becomes relevant.

An internal application might need to balance TCP connections across VM instances without inspecting web requests. A customer portal may need HTTPS termination, path-based routing to several applications and protection against common web attacks. Both might be described informally as “load balancing,” but they operate at different levels of the stack.

Azure Load Balancer operates at the transport layer

Azure Load Balancer distributes supported TCP or UDP flows between eligible backend resources using configured frontend, backend pool, rule and health-probe behavior. This makes it appropriate for many non-HTTP services and for architectures where the application protocol should remain visible end to end rather than interpreted by an HTTP proxy.

Because the service uses transport-oriented routing, it does not read a URL path and decide that /images should go to one web application while /api goes to another. If the design requires hostname or path-based application routing, that requirement points beyond transport-level balancing. Avoid asserting that one Azure Load Balancer rule provides functions belonging to a reverse proxy.

Frontends can be public or internal depending on the SKU and configuration. A backend health probe should test a condition that reasonably represents the application’s ability to serve traffic. A port that remains open after a service loses its database may yield an overly optimistic health decision. Microsoft documents the supported behavior in Azure Load Balancer guidance.

Application Gateway understands HTTP requests

Azure Application Gateway is an application-layer delivery service designed for HTTP and HTTPS workloads. It can route according to listeners and supported request attributes, integrate with a web application firewall tier, and manage TLS behavior according to its configured capabilities. Those features are useful when several web applications share an entry point or require centrally operated HTTP security controls.

For a customer portal with separate /account and /orders paths, Application Gateway can direct requests based on an approved routing rule instead of leaving every request to the same generic transport pool. The application team must still understand URL rewriting, forwarded headers, session behavior and backend health. Introducing a reverse proxy changes the path by which an application sees requests and may expose configuration assumptions in software written for direct access.

Application Gateway is a regional service, so resilience involves the chosen SKU’s zone support, backend distribution and the region’s availability architecture. It is not automatically a global failover product. Where global HTTP delivery or multi-region frontends are needed, a separate Front Door decision may be relevant.

Health probes must represent actual service readiness

Both products rely on configured or platform-supported health evaluation to avoid unhealthy backends. A health probe that checks only a process port can miss dependency failures. Conversely, a deep probe that fails whenever a noncritical downstream service is slow can remove every backend from rotation and create a full outage.

Choose a health endpoint and thresholds that represent the level of readiness required to serve the intended traffic. For a stateless API, this might include its essential dependency state. For a batch-processing service, a simple process readiness check might be more appropriate. The application owner should define success, while the network team verifies that the load-balancing product can test it correctly.

During maintenance, drain and restore one backend in a test environment. Confirm that new traffic avoids the intentionally unhealthy instance and that existing sessions are handled as designed. An Azure provisioning success state is not proof that an application-level probe produces safe routing decisions.

Review public exposure, WAF and TLS ownership

Application Gateway WAF capabilities can help inspect supported web request patterns, but WAF does not replace application security, identity authentication or ordinary network segmentation. The security team should own a clear rule-management process, including false-positive handling and logs. If a change accidentally blocks legitimate user requests, the organization must be able to identify which rule or policy caused it.

Transport-level Load Balancer does not offer equivalent application-aware WAF functionality merely because it balances HTTPS connections. Application TLS may terminate on a backend or other supported component depending on the design. Document certificate storage, rotation responsibility, supported protocols and whether encryption remains in place on the backend hop.

Network controls also matter. A public frontend should not imply that every backend VM requires a public IP or open management ports. Keep administrative access separate from application ingress, and verify source/egress routing with the expected network security policy. The load-balancing service is one layer in a secure traffic path.

Compare operational complexity and regional scope

An HTTP-aware gateway can simplify application routing while increasing configuration surface: listeners, backend settings, certificates, probes, WAF policies and request rules. A transport load balancer can be simpler when all that is needed is resilient flow distribution across a backend tier. Simpler is beneficial when it genuinely meets the functional and recovery objectives.

Cost and performance should be evaluated from the workload’s traffic, SKU requirements and security expectations. A comparison using only the hourly base price can miss capacity units, processed data, additional public IPs, WAF usage and operations work. Gather realistic traffic and test throughput before committing. A change in product later may require modifications to URL handling, DNS or certificates.

Some architectures legitimately use both at different tiers. For example, an HTTP gateway may route a web request to an application while a transport load balancer serves a separate non-HTTP internal service. That is not redundant complexity if each has a clear function and owner. Avoid stacking products merely to make a network diagram appear more secure.

Diagnose a failed request through the chosen layer

If a web request returns a 502 or similar gateway error, examine the application gateway’s backend health, listener and route configuration, TLS expectations and backend logs before replacing VMs. A timeout through a Load Balancer may require checking probe success, frontend/backend association, NSG rules, routes and whether the guest process listens on the intended port.

Use controlled comparisons: connect from an approved network directly to the backend where permissible, then through the intended frontend. The difference helps isolate the component that changes behavior. Do not turn off a WAF policy or open every subnet port merely to make the error disappear; record the denied flow and review the smallest justified correction.

A hypothetical internal TCP service that responds directly but fails through Load Balancer might have a misconfigured health probe or backend pool. A public HTTPS service that passes transport tests but fails path routing might have listener or backend settings wrong in Application Gateway. These failures look similar to an end user but require different evidence.

Choose from the request path, then test the choice

A sound selection explains protocol, frontend exposure, routing needs, health check, security controls, regional availability and operational owner. Azure Load Balancer is a strong fit for transport-level distribution; Application Gateway fits HTTP-aware routing and related web-security needs. Neither is automatically better for every application or a substitute for correct backend architecture.

A reliable choice between these services begins with one real client request and the behavior it needs: IP-and-port distribution, HTTP routing, TLS termination, or a web application firewall. Trace the request to the backend and deliberately remove one healthy instance in a test environment. The result should show both what the selected layer can protect and which application dependencies it cannot.

Continue learning

Related guides

Troubleshooting Azure VNets, Routes, and DNSDiagnose Azure route tables, NSG rules, and DNS answers for failed connections.NSGs, ASGs, and Azure FirewallPlace traffic controls at the right subnet and inspection boundary.Azure Front Door vs. Application GatewayCompare global edge delivery with regional Layer 7 ingress.

Related Posts

• Top Cloud Certifications Valuable in 2022: Is Microsoft a Leader?

• Conquer the Cloud: Your Beginner’s Blueprint for Microsoft Azure Mastery

• Microsoft AZ-104: Six-Week Study Plan

• Cloud-Native App Architecture Using Microsoft Azure Cosmos DB

• Cloud Confidence Starts Here: A Four-Part AZ-900 Certification Blueprint

• Microsoft AZ-104: Azure Storage Account Decisions

• Microsoft AZ-104: VM Availability Options

• Microsoft AZ-104: Azure Landing Zones

• Microsoft AZ-104: Troubleshoot Azure VMs

• Microsoft SC-500: Defender for Cloud Posture and Workload Protection