D5 · Monitoring

Application Insights

Application Insights is 's APM (Application Performance Management) solution. It provides deep application telemetry: requests, dependencies, exceptions, traces and availability. The AZ-104 exam evaluates its configuration and the per-service Insights solutions.

Application Insights — what it is

Application Insights is an extensible APM (Application Performance Monitoring) service that monitors live applications. It automatically detects performance anomalies, includes powerful diagnostic tools and works with multiple languages/frameworks.

Supported languages and frameworks

  • •.NET / .NET Core
  • •Java (auto-instrumentation via agent)
  • •Node.js (JavaScript/TypeScript)
  • •Python
  • •PHP, Ruby, Go (basic telemetry)
  • •JavaScript (browser) — client-side

What it monitors

  • •Request rates, response times, failure rates
  • •Dependency rates (DB, REST, Redis)
  • •Exceptions and stack traces
  • •Page views and load times (browser)
  • •Availability (external probes)
  • •Custom events and business metrics

Where it is used

  • •
  • •Azure Functions — automatic telemetry
  • •VMs and on-premises servers (with SDK)
  • •AKS — via auto-instrumentation
  • •Applications in any cloud (SDK)
  • •SPAs and mobile apps (JS SDK)

Classic vs Workspace-based

Classic (legacy)

Own isolated storage. No access from Log Analytics. Being deprecated.

Workspace-based (recommended)

Data is stored in a . KQL queries, unified RBAC, configurable retention, correlation with other workspace data.

Key concepts

• Instrumentation Key: unique key of the resource. Deprecated — migrate to Connection String.

• Connection String: complete connection configuration. Recommended for new apps.

• Sampling: to reduce data volume and costs. Adaptive sampling adjusts automatically.

• Live Metrics: real-time telemetry with no latency for debugging in production.

Instrumentation — SDK and auto-instrumentation

SDK (manual)

Include the NuGet/npm/pip package in the application and configure the Connection String. Maximum control over what is instrumented and how.

Advantages

  • +Full control of telemetry
  • +Custom events and business metrics
  • +Detailed dependency telemetry
  • +Works in any environment (on-prem, other clouds)

Limitations

  • −Requires modifying the code
  • −More initial configuration work

Auto-instrumentation (codeless)

Azure injects the agent automatically without modifying the code. Available in App Service, Azure Functions, and Java with an agent.

Advantages

  • +Zero code changes — enable in Portal or config
  • +Fast to deploy
  • +Covers common cases (HTTP, SQL, Redis)

Limitations

  • −Less control — not all telemetry types available
  • −Only available in compatible environments

Telemetry types

TypeKQL tableWhat it capturesExample
RequestsrequestsIncoming HTTP requests to the appGET /api/orders — 200ms — Success
DependenciesdependenciesCalls to external services (SQL, HTTP, Redis)SQL query "SELECT * FROM Orders" — 50ms
ExceptionsexceptionsUnhandled exceptions and errorsNullReferenceException in OrderService.cs:42
TracestracesApplication text logs (ILogger, log4j)Processing order 12345
Custom EventscustomEventsCustom business eventsOrderCompleted, UserRegistered, FeatureEnabled
Custom MetricscustomMetricsNumeric business metricsQueueLength=342, OrderValue=99.99
Page ViewspageViewsPage views (browser SDK)/checkout — 1.2s load — Chrome
AvailabilityavailabilityResultsAvailability test resultsPing https://myapp.com — Success — 120ms

Application Map

Automatic visual map of the application's dependencies. Shows all components (frontend, backend, DBs, external APIs) and the performance of each connection. Quickly identifies bottlenecks and failures. Generated automatically from dependency data.

End-to-End Transaction Diagnostics

Correlates all operations of an end-to-end request: from the HTTP request, through SQL/Redis dependencies, to logs and exceptions — all with the same correlationId. Lets you see exactly what happened at each layer of the application during a specific transaction.

Availability Tests

Availability Tests are periodic tests sent from multiple geographic Azure locations to verify that your application is available and responding correctly from the internet.

URL ping test

Simple HTTP GET to a URL. Checks response code and load time. Up to 5 simultaneous locations. Simplest and at no additional cost.

Standard test

Similar to URL ping but with support for SSL lifetime checks, custom HTTP verbs, custom headers, request body, response validation.

Custom TrackAvailability

You call the SDK with trackAvailability() to report results of custom availability tests — e.g. login tests, end-to-end business flows.

Configuring availability alerts

• Test frequency: 5, 10 or 15 minutes

• Locations: choose 5+ to detect regional outages

• Alert threshold: e.g. alert if 3 out of 5 locations fail

• Retry logic: the test retries before considering it a failure, to reduce false positives

• Results are stored in the availabilityResults table

Smart Detection

Smart Detection is automatic detection of performance and failure anomalies using machine learning. It doesn't require configuring thresholds — it learns the app's normal behavior and alerts when it detects significant deviations.

Failure Anomalies

Detects abnormal increases in the failure rate of requests or dependencies, comparing against the app's historical baseline. It accounts for patterns like more failures on high-traffic days.

Performance Degradation

Detects degradation in response times of requests or dependencies. Alerts when the P90 percentile increases significantly relative to the baseline.

Memory Leak Detection

Detects memory usage growth patterns that suggest memory leaks. Useful for catching issues before they cause OOM in production.

Slow Page Load

Detects specific pages with abnormally slow load times compared to the history of the same page.

VM Insights and Container Insights

VM Insights

Predefined monitoring solution for VMs and VMSS. Provides curated performance views (CPU, memory, disk, network), a dependency map (which processes are connecting to what) and an agent data table.

• Requires: Azure Monitor Agent + Data Collection Rule

• Performance view: metrics for the top N VMs by CPU/memory

• Map view: visualization of TCP connections between processes and VMs

• Supports Azure Arc (on-premises machines)

• Data in tables: InsightsMetrics, VMComputer, VMConnection

Container Insights

Monitoring solution for AKS and containers. Collects metrics and logs from nodes, pods and containers.

• Enable from: AKS → Monitoring → Insights or from Azure Monitor

• Metrics: node and pod CPU and memory, pod count

• Container logs: stdout/stderr of each container

• Curated views: Cluster utilization, Node utilization, Pod failures

• Data in tables: ContainerLog, KubePodInventory, KubeNodeInventory

Did you get this topic?

Test what you just learned

A web application on Azure App Service is experiencing intermittent 500 errors. An administrator wants to see the full stack trace and correlate the errors with the database queries that preceded them. Which tool provides this visibility?

Ready to test "Application Insights"?

Put what you learned to the test with original AZ-104 exam questions.

Start AZ-104 mock exam

Unlimited mock exams with the Pro plan

Log in to track your progress.