Microsoft AZ-204: Azure Monitoring, Diagnostics and DevOps Integration — Study Guide

Part of the Microsoft Azure Developer Associate AZ-204 — Study Guide. Practice with verified answers in the Microsoft exam hub, or take timed practice tests on ExamRoll.io.

Overview

Azure Monitor and Application Insights provide a unified, developer-focused observability stack for Azure applications. Application Insights collects application telemetry such as requests, dependencies, exceptions, and traces, while Azure Monitor aggregates metrics and logs across resources into a Log Analytics workspace and drives alerting and DevOps integrations. Mastering instrumentation choices, telemetry semantics, availability testing, Kusto Query Language (KQL), alerting with action groups, distributed tracing, and Infrastructure as Code with ARM templates ensures reliable, diagnosable, and automatable solutions.

Application Insights instrumentation and telemetry

Application Insights resources are identified for ingestion by either an instrumentation key or a connection string. The instrumentation key is the legacy single GUID used by SDKs to route telemetry. The connection string is the current recommendation; it includes the instrumentation key plus endpoint metadata (ingestion and Live Metrics endpoints) and allows routing to non-default endpoints (for sovereign or private clouds). Use the connection string in new code and configuration; it enables future endpoint changes without code redeployments. Within an App Service, enabling Application Insights at the platform level will populate the connection string into environment settings for auto-detected runtimes.

Instrumentation can be done via SDK or auto-instrumentation. The SDK approach (for example, Microsoft.ApplicationInsights.AspNetCore for .NET, applicationinsights for Node.js, and Application Insights Java agent) offers code-level control: custom events, metrics, and enriched telemetry via TelemetryInitializers and processors, including adaptive sampling. Auto-instrumentation (codeless attach) is available for App Service and some compute stacks and uses site extensions/agents to collect incoming requests, dependencies, and exceptions with no code changes. Use SDK instrumentation when you need custom events, business metrics, or explicit correlation in background jobs; use codeless attach for rapid, low-effort visibility or for lift-and-shift workloads. In both cases set the cloud role name to distinguish services in a microservices architecture and configure sampling carefully to balance fidelity and cost.

Application Insights emits several core telemetry types:

Distributed tracing in Application Insights hinges on correlation. Each end-to-end operation has an operation ID (trace ID in W3C terms) shared across related telemetry; each span has parent-child relationships enforced by propagation headers. Modern SDKs use the W3C Trace Context (traceparent, tracestate). Operation_Id in KQL ties Requests, Dependencies, Exceptions, and Traces for the same transaction. Ensure outbound HTTP clients propagate headers; for .NET, System.Diagnostics.Activity and the AI SDK handle this automatically. Dependency tracking instruments common clients (HTTP, SQL, Service Bus, Storage). When services cross boundaries (e.g., App Service to AKS), consistent propagation yields a single connected transaction map. For async and message-based flows, ensure the SDKs capture and flow correlation IDs in message metadata; most Azure SDKs do this by default.

Availability testing and synthetic monitoring

Availability tests validate external reachability and responsiveness from multiple geographies. The URL ping test issues HTTP requests at a configured frequency from multiple test locations and validates status codes, SSL health, and optional content match. Use retries and multiple locations to reduce false positives and configure alerts on test failures for actionable notifications.

Multi-step availability tests historically executed recorded sequences of HTTP requests with stateful cookies to verify workflows. Classic multi-step web tests have been retired; for multi-request or authenticated scenarios, implement synthetic tests by instrumenting your own client or service using the TrackAvailability API (or OpenTelemetry exporters) to emit AvailabilityTelemetry. This approach allows custom authentication, payloads, and domain-specific validation while retaining centralized reporting and alerting.

Custom TrackAvailability gives you control over:

Combine availability tests with backend dependency and request telemetry to quickly differentiate endpoint availability issues (network, DNS, TLS) from application failures (exceptions, timeouts) and downstream outages (SQL, external APIs). Tie availability test failures to action groups to drive incident workflows.

Azure Monitor data, KQL, and alerting with action groups

Azure Monitor ingests two primary data types: metrics and logs. Metrics are lightweight, numeric time series with near real-time ingestion and multi-dimensional slicing (e.g., by instance, API route). They are best for fast detection (CPU, memory, request rate, latency, availability) and support up to 93 days retention by default. Logs are structured, queryable records stored in a Log Analytics workspace and include Application Insights data, platform resource logs, and custom logs with configurable retention. Use Diagnostic settings to route platform metrics and resource logs to a workspace, Event Hub, or Storage for archival and analytics.

Kusto Query Language (KQL) powers exploratory analysis, dashboards, and log alerts. Core patterns include:

Alerting spans metrics and logs. Metric alerts evaluate metric thresholds in near real time, support dimensions and splitting by dimension, and can use static or dynamic thresholds (ML-based baselines). They are stateful and can fire and auto-resolve based on evaluation results, producing one notification when state changes. Log (scheduled query) alerts run KQL on a cadence and trigger on query results (number of matches or measure thresholds). Use log alerts when conditions depend on complex patterns across tables or require text analysis. Smart detection and anomaly alerts in Application Insights can highlight regressions without explicit thresholds.

Action groups define reusable response sets for alerts. Notification types include email, SMS, voice, and Azure mobile app push. Integrations include:

ARM templates for monitorability and repeatable deployment

Azure Resource Manager (ARM) templates declaratively define resources and monitoring configuration as code. A template’s structure includes:

Use linked or nested templates to compose complex deployments. A deployment resource (Microsoft.Resources/deployments) references a child template via templateLink (external URI) or embeds it inline. Pass parameter objects via parameters or parametersLink, define dependsOn for ordering, and reuse modules across environments. Examples of monitorability-by-default through ARM:

Adopt conditions and copy loops for scalable deployments (e.g., apply diagnostic settings to a set of resource IDs). Use ARM functions such as resourceId, subscriptionResourceId, reference, concat, and guid to build dynamic references and stable names. Keep telemetry configuration consistent across services by centralizing role name conventions and sampling in app settings delivered via ARM or App Service configuration resources.

Practical Problem Scenario

Adobe needs end-to-end observability for a new multi-region media processing pipeline built on Azure App Service APIs and AKS microservices. They require fast detection of latency regressions, distributed tracing across services, proactive availability checks for public endpoints, and automated incident routing to their on-call system with infrastructure-as-code repeatability.

  1. Instrument services with Application Insights using connection strings
  1. Enable distributed tracing and dependency tracking
  1. Implement availability tests and custom synthetic checks
  1. Centralize data in a Log Analytics workspace and route platform logs
  1. Create metric and log alerts with action groups
  1. Integrate incident response via action groups and webhooks
  1. Codify monitoring with ARM templates
  1. Validate with KQL dashboards

Azure Caching · All domains

Practice these questions → · Timed practice on ExamRoll.io →

Pass the whole exam — not just this question

You found this answer. Get every verified question and explanation in one place, and save hours of prep. Free to start.

Pass your exam →

Browse Microsoft →

Related guides

All-in-one access

One subscription. Every exam.

Every plan unlocks unlimited answer search, practice tests, AI explanations, and the full resource library — in 20+ languages.

Monthly
24.87
Just €0.83/day
Everything included:
  • Unlimited answer search
  • Unlimited practice tests
  • AI-powered explanations
  • Full resource library
  • 20+ languages
  • Weekly content updates
  • Rewards & referrals
  • Priority support
Start free trial

No credit card required*

Best value
12 months
179.87
Just €0.49/daySave 40%
Everything included:
  • Unlimited answer search
  • Unlimited practice tests
  • AI-powered explanations
  • Full resource library
  • 20+ languages
  • Weekly content updates
  • Rewards & referrals
  • Priority support
Start free trial

No credit card required*

✓ Free plan included · ✓ Cancel anytime · ✓ All plans unlock the full product