Health Probes and Graceful Degradation
Configure load balancer and Traffic Manager health probes to detect failures quickly, and design circuit-breaker and graceful degradation patterns for your application tier.
Health Probes and Graceful Degradation is a free Cloud & IT Cert Prep lesson on CoddyKit — lesson 4 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Cloud & IT Cert Prep learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Why Health Probes Are Essential
Health probes are the mechanism by which load balancers and traffic managers detect whether a backend instance is capable of serving requests. Without health probes, a load balancer might continue sending traffic to a failed or unresponsive server, causing user-facing errors. Properly configured health probes enable automatic traffic rerouting away from unhealthy instances within seconds of a failure.
Azure Load Balancer Health Probes
Azure Load Balancer supports two types of health probes:
- TCP probe — checks if the backend can accept a TCP connection on a specified port. Simple but does not verify application logic.
- HTTP/HTTPS probe — sends a GET request to a specified path and expects a 200 OK response. More accurate because it tests the application endpoint directly.
A backend is marked unhealthy if the probe fails for a configurable number of consecutive attempts.
# Create an HTTP health probe for an Azure Load Balancer:
az network lb probe create \
--resource-group myRG \
--lb-name myLoadBalancer \
--name httpHealthProbe \
--protocol Http \
--port 80 \
--path /health \
--interval 15 \
--threshold 2Designing a Reliable Health Endpoint
A well-designed health endpoint (/health) does more than return 200 OK — it verifies that the application's critical dependencies are reachable. A comprehensive health check might test connectivity to the database, the cache, and any downstream APIs. If any dependency is unavailable, the endpoint returns a 5xx status code, signalling the load balancer to remove this instance from rotation.
# Example health endpoint response (JSON):
# GET /health
# {
# 'status': 'healthy',
# 'checks': {
# 'database': 'ok',
# 'cache': 'ok',
# 'externalApi': 'ok'
# }
# }
# If database check fails, return HTTP 503 instead of 200Traffic Manager Health Probes
Azure Traffic Manager also uses health probes, but at the regional level. It sends periodic HTTP or HTTPS GET requests to the configured endpoint URL in each region. If an endpoint fails to respond within the timeout window for a set number of consecutive intervals, Traffic Manager marks that endpoint as degraded and stops routing DNS queries to it, redirecting users to a healthy region.
# Configure Traffic Manager health probe settings:
az network traffic-manager profile update \
--resource-group myRG \
--name myTMProfile \
--monitor-protocol HTTPS \
--monitor-port 443 \
--monitor-path /health \
--monitor-interval 30 \
--monitor-timeout 10 \
--monitor-tolerated-failures 3Application Gateway Health Probes
Azure Application Gateway has more sophisticated health probe capabilities than the standard Load Balancer. It supports custom probes that specify the host header, the expected status code range (e.g., 200-399), and a body match string. Application Gateway also supports per-path routing, so different backend pools can have different health probe configurations for different URL paths.
# Create a custom probe for Application Gateway:
az network application-gateway probe create \
--gateway-name myAppGateway \
--resource-group myRG \
--name customProbe \
--protocol Http \
--host-name-from-http-settings true \
--path /api/health \
--interval 20 \
--timeout 10 \
--threshold 3What Is Graceful Degradation?
Graceful degradation is the ability of an application to continue providing partial functionality when one or more of its dependencies fail. Instead of crashing entirely, the application detects the unavailability of a non-critical service and falls back to a degraded but still useful state. For example, if a recommendation service fails, an e-commerce site could show generic suggestions instead of crashing the entire product page.
The Circuit Breaker Pattern
The circuit breaker pattern prevents an application from repeatedly calling a failing downstream service. When a service starts failing, the circuit breaker opens and immediately returns an error or fallback response without making the network call. After a cool-down period, it enters a half-open state and allows a trial request. If that succeeds, the circuit closes and normal operation resumes.
# Circuit breaker states:
# CLOSED: normal operation, calls pass through
# OPEN: service failing, calls immediately return error/fallback
# HALF-OPEN: cool-down expired, try one request:
# success -> CLOSED
# failure -> OPEN (reset timer)
# Libraries: Polly (.NET), Resilience4j (Java), polly-js (JS)Retry with Exponential Backoff
For transient failures (brief network blips, temporary service overload), a retry with exponential backoff strategy is appropriate. The application retries the failed call after a delay, doubling the delay with each retry up to a maximum. Adding a jitter (random variation) to the delay prevents all retry attempts from synchronising and overwhelming a recovering service.
# Exponential backoff with jitter (pseudocode):
# attempt 1: wait 1s + random(0-500ms)
# attempt 2: wait 2s + random(0-500ms)
# attempt 3: wait 4s + random(0-500ms)
# attempt 4: wait 8s + random(0-500ms)
# max retries: 4
# max wait: 30s (cap)
# After max retries: return error to callerBulkhead Pattern
The bulkhead pattern isolates different parts of an application into resource pools so that a failure in one area does not consume all resources and bring down the entire system. Named after ship bulkheads that prevent one flooded compartment from sinking the whole vessel. In Azure, this might mean using separate thread pools or separate App Service plans for different services to contain failures.
Fallback Responses and Cached Data
A common graceful degradation technique is to serve cached or stale data when a live data source is unavailable. For example, a product catalogue page might serve yesterday's cached prices from Azure Cache for Redis rather than showing an error if the database is temporarily unreachable. Users experience a minor inconvenience (slightly stale prices) rather than a complete failure.
Monitoring and Alerting on Degradation
Graceful degradation should be visible and measured. Use Application Insights to track the rate of circuit breaker opens, fallback responses, and retry attempts as custom metrics. Set up alerts when these metrics exceed thresholds, so the on-call team is notified that the application is running in a degraded state even if the user-facing experience appears acceptable.
Quick Check
Test your understanding of Microsoft Azure Fundamentals (AZ-900) concepts from this lesson.
Lesson Recap
In this lesson you learned: health probes allow load balancers to detect failed backends and reroute traffic automatically; graceful degradation keeps applications partially functional when dependencies fail; and patterns like circuit breaker, retry with backoff, and bulkhead implement resilience at the application level. Next up we explore disaster recovery concepts — defining RTO, RPO, and recovery tiers.
Frequently asked questions
Is the “Health Probes and Graceful Degradation” lesson free?
Yes — the full text of “Health Probes and Graceful Degradation” is free to read here on the web, and the Cloud & IT Cert Prep course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Cloud & IT Cert Prep course, upgrade to CoddyKit PRO.
What will I learn in “Health Probes and Graceful Degradation”?
Configure load balancer and Traffic Manager health probes to detect failures quickly, and design circuit-breaker and graceful degradation patterns for your application tier. You practise Cloud & IT Cert Prep with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Cloud & IT Cert Prep?
No prior experience is required. Cloud & IT Cert Prep on CoddyKit is structured for beginners through advanced learners; this is — lesson 4 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Health Probes and Graceful Degradation” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Cloud & IT Cert Prep lesson?
Yes. Every Cloud & IT Cert Prep lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Azure SLAs and Composite SLAs
- Availability Sets and Availability Zones
- Multi-Region Active-Active Architecture
- Health Probes and Graceful Degradation