Last updated: May 2026
Azure App ServiceIntermediateAZ-104⏱ 11 min read

App Service Monitoring & Diagnostics

Knowing your app is running is just the start — you need to understand how it performs, why it fails, and how to diagnose problems quickly. Azure App Service has deep monitoring integration with Application Insights, built-in diagnostic logs, real-time log streaming, and the powerful Kudu console for deep debugging.

What you'll learn Application Insights integration · Built-in metrics · Diagnostic logs (application, web server, detailed errors) · Log streaming · Health check endpoint · Kudu / Advanced Tools console · App Service Diagnostics (Diagnose and Solve Problems) · Alerts on metrics

Application Insights

Application Insights is Azure's APM (Application Performance Monitoring) service — the recommended way to monitor App Service apps. Once enabled, it automatically collects:

  • Request telemetry — Every HTTP request: URL, response time, status code, user
  • Exceptions — All unhandled exceptions with stack traces
  • Dependencies — Outbound calls to databases, APIs, storage with timing
  • Custom events and metrics — Track business events from your code
  • Live Metrics — Real-time stream of requests, failures, and performance
💡
Enable Codeless Monitoring For .NET, Node.js, Java, and Python apps, Application Insights can be enabled from App Service settings without any code changes — no SDK required. The agent auto-instruments your application at the platform level.

Built-in Metrics

App Service exposes metrics in Azure Monitor — viewable in the Metrics blade:

MetricWhat It MeasuresAlert On
CPU PercentageAverage CPU usage across instances>80% sustained
Memory Working SetCurrent memory usage>85% of available
Http 5xxServer error rateAny increase above baseline
Http 4xxClient error rateSudden spikes
Average Response TimeTime to serve requestsAbove SLA threshold
RequestsTotal requests per secondFor capacity planning
Http Queue LengthRequests waiting to be processed>0 for extended period

Diagnostic Logs

Enable diagnostic logging (App Service → Monitoring → App Service logs) to capture:

Log TypeWhat It ContainsStorage
Application loggingConsole.log / logging framework output from your app codeFile system or Blob Storage
Web server loggingIIS/HTTP access logs — every request with status, bytes, IPFile system or Blob Storage
Detailed error messagesFull HTML error pages for HTTP 4xx/5xx errorsFile system
Failed request tracingDetailed trace of each failed request (IIS trace)File system
⚠️
File System Logs Are Temporary File system diagnostic logs are automatically disabled after 12 hours — they're designed for quick troubleshooting, not long-term storage. For persistent logging, configure Blob Storage as the destination.

Log Streaming

Stream application logs in real-time to your terminal — like tailing a log file. Useful for immediate debugging without accessing the file system:

Azure CLIStream logs in real-time
# Stream app logs
az webapp log tail \
  --name mywebapp-2026 \
  --resource-group myRG

# Stream with filter
az webapp log tail \
  --name mywebapp-2026 \
  --resource-group myRG \
  --provider http

Health Check

Configure a health check endpoint path (e.g., /health) that App Service pings every minute. If an instance returns non-2xx responses for multiple checks, App Service:

  • Removes the unhealthy instance from the load balancer
  • Attempts to restart it
  • If still unhealthy after restart, replaces it with a new instance (Premium and above)
Azure CLIConfigure health check endpoint
# Set health check path
az webapp config set \
  --name mywebapp-2026 \
  --resource-group myRG \
  --generic-configurations '{"healthCheckPath":"/health"}'

Kudu — Advanced Tools

Kudu is the deployment and debugging console for App Service — accessible at https://mywebapp.scm.azurewebsites.net. It provides:

  • Debug console — CMD/Bash access to the app's file system
  • Process Explorer — View running processes, CPU/memory per process
  • Log files — Browse diagnostic log files
  • Environment variables — View all app settings injected into the environment
  • Deployment history — View and manage past deployments
  • REST API — Automate deployments and diagnostics
💡
Kudu for Quick Debugging If your app isn't starting, go to Kudu → Debug Console → navigate to the app folder and run your start command manually to see the actual error. This is often faster than decoding compressed log files.

Diagnose and Solve Problems

The built-in "Diagnose and solve problems" blade (App Service → Diagnose and solve problems) provides guided diagnosis for common issues — availability, performance, configuration problems. It automatically analyses recent metrics, logs, and deployments to identify likely root causes.

Setting Up Alerts

Azure CLICreate alert for HTTP 5xx errors
# Create metric alert for 5xx errors
az monitor metrics alert create \
  --name Http5xxAlert \
  --resource-group myRG \
  --scopes /subscriptions//resourceGroups/myRG/providers/Microsoft.Web/sites/mywebapp-2026 \
  --condition "avg Http5xx > 5" \
  --window-size 5m \
  --evaluation-frequency 1m \
  --action myActionGroup
💡
AZ-104 Exam Tip Know Application Insights for APM (request tracing, exceptions, dependencies). Know diagnostic logs — file system logs auto-disable after 12 hours. Know that Health Check removes unhealthy instances from load balancer. Know Kudu provides file system and process access via browser.
📝 Practice Questions
Click an option to check your answer.
Q1. Which monitoring service provides request tracing, exception tracking, and dependency monitoring for Azure App Service?
A — Azure Monitor
B — Application Insights
C — Azure Security Center
D — Azure Network Watcher
Q2. How long do file system diagnostic logs remain enabled in App Service?
A — 12 hours — they auto-disable to prevent disk space issues
B — 24 hours
C — 7 days
D — Until manually disabled
Q3. What does the App Service Health Check feature do when an instance fails health checks?
A — Logs the failure to Application Insights only
B — Removes the instance from the load balancer, restarts it, and replaces it if still unhealthy
C — Immediately terminates and deletes the unhealthy instance
D — Sends an email alert to the administrator only
Q4. What is Kudu in the context of Azure App Service?
A — A deployment pipeline tool for GitHub integration
B — The advanced debugging console with file system access, process explorer, and deployment history
C — The Application Performance Monitoring service
D — The auto-scaling rules engine
Q5. A developer wants to see application log output in real-time without downloading log files. Which feature should they use?
A — Application Insights Live Metrics
B — Log Streaming (az webapp log tail)
C — Deployment Center
D — Auto-scale history
Comments
Disclaimer: RedKite Cloud is an independent educational resource and is not affiliated with Microsoft Corporation.