Study guide
15.2 Application Insights & Specialized Azure Monitor Insights
Microsoft Certified: Azure DevOps Engineer Expert AZ-400
Track your progress as you read
Finished sections get a check mark.
1 Chapter 1: Flow of Work, Traceability & Work Tracking
1.1 Flow of Work, GitHub Flow & Feedback Cycles 1.2 Work Tracking with Azure Boards & GitHub Projects 1.3 End-to-End DevOps Traceability & Quality Tracking
2 Chapter 2: DevOps Metrics, Dashboards & Team Collaboration
2.1 DORA Metrics, Flow Metrics & Dashboard Design 2.2 Lifecycle Metrics Across the Six DevOps Phases 2.3 Work Item Queries, WIQL Charts & Analytics 2.4 Project Documentation: Wikis, Mermaid Diagrams & Release Notes 2.5 Webhooks, Service Hooks & Microsoft Teams ChatOps
3 Chapter 3: Git Branching Strategies & Pull Request Workflows
3.1 Git Branching Models & Strategy Design 3.2 Pull Request Workflows & Merge Strategies 3.3 Branch Policies, Quality Gates & Compliance Restrictions
4 Chapter 4: Repository Management, Optimization & Git Data Operations
4.1 Git LFS Architecture & .gitattributes Tracking 4.2 LFS History Migration, git-fat & File Locking 4.3 Git Repository Scaling, Scalar & Monorepo Governance 4.4 Repository Permissions & Git Tag Governance 4.5 Git Data Recovery & Sensitive-Data Scrubbing
5 Chapter 5: Package Management & Dependency Versioning
5.1 Selecting Package Tools: Azure Artifacts vs. GitHub Packages 5.2 Feed Scoping, Upstream Sources & Pipeline Authentication 5.3 Package Views, Immutability & Quality Promotion 5.4 Dependency Versioning: SemVer, CalVer & Automated Versioning 5.5 Pipeline Artifact Versioning & Artifact Storage Strategy
6 Chapter 6: Pipeline Infrastructure, Agents & Integration
6.1 Selecting a CI/CD Solution: Azure Pipelines vs. GitHub Actions 6.2 GitHub-Azure Pipelines Integration & Hybrid Migration 6.3 Hosted vs. Self-Hosted Agents & Runners 6.4 VMSS Elastic Pools, Container Jobs & Agent Governance 6.5 Pipeline Triggers, Filters & Concurrency Management
7 Chapter 7: YAML Pipeline Architecture & Reusable Elements
7.1 YAML Pipeline Anatomy: Stages, Jobs, Steps & Workspaces 7.2 Job Execution Order: DAG Dependencies, Parallelism & Conditions 7.3 Reusable Elements: Templates, Parameters & Variables 7.4 Variable Groups, Secret Variables & Key Vault Linking 7.5 YAML Environments, Checks & Deployment Approvals
8 Chapter 8: Testing Strategy, Quality Gates & Code Coverage
8.1 Test Strategy Design: Local, Unit & Integration Testing 8.2 Load, Stress & Performance Testing in Pipelines 8.3 Test Execution Tasks, Agents & Results Integration 8.4 Code Coverage Analysis & SonarQube Integration 8.5 Quality Gates, Release Gates & Governance Checks
9 Chapter 9: Modern Deployment Strategies & Zero-Downtime Delivery
9.1 Progressive Delivery: Blue-Green, Canary & Ring Deployments 9.2 Minimizing Downtime: Deployment Slots & Rolling Updates 9.3 Feature Flags with Azure App Configuration & Feature Manager 9.4 Designing the High-Priority Hotfix Path 9.5 Ordered Dependency Deployments, Resiliency & Rollback
10 Chapter 10: Artifact Deployment & Database DevOps
10.1 Containerized Application Delivery: ACR, AKS & Container Apps 10.2 Binary, Web App, Function & Scripted Deployments 10.3 Database DevOps: State-Based & Migration-Based Strategies
11 Chapter 11: Infrastructure as Code (IaC) & Azure Deployment Environments
11.1 Infrastructure as Code Strategy: Bicep, ARM & Terraform 11.2 Desired State Configuration & Azure Machine Configuration 11.3 Azure Deployment Environments (ADE) & Developer Self-Service
12 Chapter 12: Pipeline Maintenance, Health & Modernization
12.1 Pipeline Health, Flaky Tests & Reliability Engineering 12.2 Pipeline Optimization: Caching, Slicing & Concurrency 12.3 Artifact & Build Retention Governance 12.4 Modernizing CI/CD: Classic to YAML Migration
13 Chapter 13: Authentication, Authorization & Identity Governance
13.1 Microsoft Entra Service Principals & Managed Identities 13.2 Service Connections, Workload Identity & Personal Access Tokens 13.3 Azure DevOps Projects, Teams & Permission Evaluation 13.4 Access Levels, GitHub Roles & Outside Collaborators
14 Chapter 14: Secrets Management, Sensitive Data & DevSecOps Scanning
14.1 Azure Key Vault, Secret Variables & Secretless CI/CD 14.2 Security Scanning Strategy, GHAS & Secret Scanning 14.3 CodeQL SAST in Pipelines and Containers 14.4 Software Supply Chain, Container Scanning & Cloud Defender
15 Chapter 15: Telemetry Collection, Azure Monitor & Alerting
15.1 Azure Monitor Architecture, AMA & Data Collection Rules 15.2 Application Insights & Specialized Azure Monitor Insights 15.3 Alerting Rules, Action Groups & GitHub Repository Insights
16 Chapter 16: Telemetry Analysis, Distributed Tracing & SRE Practices
16.1 Distributed Tracing, Application Map & Exception Triage 16.2 KQL Log Analytics, SRE Observability & Error Budgets
15.2 Application Insights & Specialized Azure Monitor Insights
Key Takeaways Explain This Topic AI
Application Insights requires an ingestion connection string; the legacy instrumentation key is deprecated because it lacks regional targeting and authenticated ingestion.
Codeless auto-instrumentation captures requests, dependencies and exceptions without a code change, while the SDK adds custom events, metrics and telemetry initialisers.
VM Insights reports processor utilisation, memory pressure, disk IOPS and network throughput, and its Service Map shows TCP dependencies between machines.
Container Insights collects node and pod CPU and memory against Kubernetes requests and limits through the ama-logs daemonset.
Adaptive sampling is the SDK default and adjusts the rate to a target items-per-second budget, preserving related telemetry within a single operation.
Last updated: September 2026
15.2 Application Insights & Specialized Azure Monitor Insights
The agent and data collection rules get platform and guest telemetry into the workspace. Application Insights and the specialized Insights experiences are what turn that raw telemetry into application-level and workload-level answers.
1. Application Insights: Deep Application Performance Management (APM)
Application Insights is the application performance management (APM) feature of Azure Monitor. It instruments running code to monitor live application health, identify latency bottlenecks, trace distributed microservice calls, and track business conversion flows.
Ingestion Connection Strings vs. Legacy Instrumentation Keys
Earlier iterations of Application Insights relied on a static GUID called the Instrumentation Key (iKey) . The iKey is deprecated because it lacked regional ingestion targeting and authenticated access controls.
Modern Application Insights requires an Ingestion Connection String , which encapsulates the target ingestion endpoint, regional routing, and authorization credentials: InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://eastus-8.in.applicationinsights.azure.com/;LiveEndpoint=https://eastus.livediagnostics.monitor.azure.com/
Codeless / Auto-Instrumentation vs. SDK-Based Instrumentation
A primary architectural decision tested on the AZ-400 exam is choosing between codeless auto-instrumentation and code-based SDK instrumentation .
Dimension Codeless Auto-Instrumentation Code-Based SDK / OpenTelemetry
Implementation Enabled via Azure Portal, ARM/Bicep template, or App Service configuration toggle without modifying or recompiling source code Added as a dependency package (NuGet, npm, Maven, pip) inside source code and configured in startup files
Supported Platforms Azure App Service (.NET, Java, Node.js), Azure Functions, Azure Kubernetes Service (AKS) via application monitoring add-on Any hosting platform: Azure, on-premises, AWS, GCP, local developer workstations
Telemetry Captured Standard incoming HTTP requests, unhandled exceptions, outbound HTTP/SQL dependencies, CPU/memory performance counters Standard telemetry PLUS custom business metrics, custom event tracing, and in-depth business context
Customization Capability Minimal; cannot instantiate custom event telemetry or inject custom telemetry initializers Full programmatic control : TelemetryInitializers, TelemetryProcessors, custom dimensions, business gauges
Maintenance Overhead Lowest; agent updates are managed automatically by Azure platform extensions Higher; requires maintaining library package versions and recompiling/redeploying application code
Telemetry Data Model
Application Insights stores telemetry in dedicated tables within its underlying Log Analytics workspace:
requests : Inbound HTTP/gRPC requests, including URL, HTTP method, response duration, status code (200, 404, 500), and success boolean.
dependencies : Outbound network interactions, such as SQL database calls, HTTP REST calls to downstream services, Azure Service Bus queues, or Azure Blob storage requests.
exceptions : Unhandled runtime crashes, caught exceptions explicitly passed to telemetry, call stacks, and inner exceptions.
traces : In-process diagnostic logging generated through framework loggers ( ILogger , log4j , winston , Serilog ).
pageViews : Client-side single-page application (SPA) navigation and page load timings captured via the Application Insights JavaScript SDK.
customEvents & customMetrics : Explicit business telemetry emitted via TelemetryClient.TrackEvent() or TelemetryClient.TrackMetric() .
Code Example: SDK Custom Enrichment with TelemetryInitializer
When running in enterprise multi-tenant environments, DevOps engineers enrich all outgoing telemetry with deployment and tenant metadata: using Microsoft.ApplicationInsights.Channel;
using Microsoft.ApplicationInsights.Extensibility;
- // Custom TelemetryInitializer runs on EVERY telemetry item before transmission
- public class DeploymentTelemetryInitializer : ITelemetryInitializer
- {
- private readonly string _deploymentRing;
- private readonly string _gitCommitHash;
- public DeploymentTelemetryInitializer(string ring, string commit)
- {
- _deploymentRing = ring;
- _gitCommitHash = commit;
- }
- public void Initialize(ITelemetry telemetry)
- {
- // Enrich telemetry with deployment ring (Ring0, Ring1) and Git SHA
- if (!telemetry.Context.GlobalProperties.ContainsKey("DeploymentRing"))
- {
- telemetry.Context.GlobalProperties.Add("DeploymentRing", _deploymentRing);
- telemetry.Context.GlobalProperties.Add("GitCommit", _gitCommitHash);
- }
- }
- }
- Application Insights Sampling Strategies
High-traffic enterprise applications can generate hundreds of gigabytes of telemetry daily. To reduce cost and prevent network throttling, Application Insights provides three sampling mechanisms:
Adaptive Sampling : The default mechanism for .NET and ASP.NET Core SDKs. Dynamically adjusts the sampling percentage based on current traffic volume. If traffic surges, sampling drops to keep transmission within configured rates. Crucially, adaptive sampling ensures related telemetry (a request, its downstream SQL dependencies, and resulting exceptions) are retained or dropped together as a coherent trace.
Fixed-Rate Sampling : Configured statically in application configuration (e.g., sample exactly 25% of all traffic). Operates consistently regardless of volume.
Ingestion Sampling : Applied at the Azure Monitor ingestion endpoint after data arrives in the cloud. It drops incoming records that exceed rate limits. Exam Warning : Ingestion sampling drops items randomly without preserving cross-telemetry correlation, and the network bandwidth from host to cloud has already been consumed. Use SDK-level adaptive sampling instead!
2. Specialized Azure Monitor Insights
Beyond core metrics and logs, Azure Monitor provides turnkey, curated domain monitoring solutions called Insights . [Azure Monitor Insights]
- ┌───────────────────┼───────────────────┬───────────────────┐
- ▼ ▼ ▼ ▼
- [VM Insights] [Container Insights] [Storage Insights] [Network Insights]
- Guest OS metrics • AKS cluster health • Transaction latency • Traffic Analytics
- Service Map • Pod CPU/Memory limits • Ingress/Egress MB • NSG Flow Logs
- TCP Dependencies • Prometheus scrape • Capacity & Throttling• Connection Monitor
- 1. Azure VM Insights
VM Insights monitors the performance and health of virtual machines and virtual machine scale sets.
Performance : Pre-built workbooks analyzing processor utilization, memory pressure, disk read/write IOPS, and network throughput.
Map (Service Map) : Deployed as a dependency agent extension alongside AMA. Discovers running processes and active TCP network connections across servers in real time. For DevOps teams executing cloud migrations or debugging cascading failures, Service Map reveals upstream callers, downstream database dependencies, and failed connection attempts across ports.
2. Azure Container Insights
Container Insights monitors Azure Kubernetes Service (AKS), Azure Arc-enabled Kubernetes, and Azure Container Instances.
Architecture : Deployed as a specialized containerized Azure Monitor Agent daemonset ( ama-logs ) running on every cluster node.
Telemetry Gathered : CPU and memory utilization against Kubernetes resource requests and limits ( KubeNodeInventory , KubePodInventory ), pod lifecycle crash loops ( CrashLoopBackOff ), and container stdout/stderr console logs.
Prometheus Metric Collection : Container Insights includes a managed Prometheus scraping engine. It automatically scrapes Prometheus-formatted metric endpoints exposed by Kubernetes pods (e.g., /metrics ) and stores them in Azure Monitor Managed Service for Prometheus without requiring a self-hosted Prometheus/Thanos cluster.
3. Azure Storage & Network Insights
Storage Insights : Tracks end-to-end transaction latency, server latency, blob capacity, and HTTP 4xx/5xx authorization and throttling errors across Blob, File, Table, and Queue services.
Network Insights & Traffic Analytics : Analyzes Network Security Group (NSG) flow logs and Virtual Network flow logs. Traffic Analytics decodes IP flows to identify malicious traffic, geographic traffic distribution, internal subnet bottlenecks, and cross-region egress costs.
3. Diagnostic Settings: Routing Resource Logs and Metrics
Every native Azure resource (Key Vaults, Cosmos DB, Application Gateways, AKS clusters, Azure SQL) emits two streams of operational data:
Resource Metrics : Numerical metrics emitted automatically to Azure Monitor Metrics.
Resource Logs (formerly Diagnostic Logs) : Detailed internal event logs (e.g., Key Vault secret access audit logs, Application Gateway access logs, firewall rule evaluations).
To capture and retain Resource Logs, DevOps engineers must configure Diagnostic Settings . [Azure PaaS / IaaS Resource]
- (e.g., Azure Key Vault / AKS)
- │
- [Diagnostic Settings Engine]
- │
- ┌──────────────────────┼──────────────────────┐
- ▼ ▼ ▼
- [Log Analytics Workspace] [Azure Storage Account] [Azure Event Hub]
- KQL interactive queries • Long-term compliance • Real-time streaming
- Cross-resource joins • 1-to-10 year archival • Third-party SIEM
- Sentinel / Alert rules • Lowest storage cost • Splunk / Datadog
- Destination Routing Comparison
Destination Primary Purpose Architectural Considerations
Log Analytics Workspace Centralized querying, correlation, and alerting Enables rich KQL queries and Microsoft Sentinel SIEM integration. Incurs data ingestion and retention charges.
Azure Storage Account Long-term archival and compliance audit retention Best for regulatory mandates (e.g., PCI-DSS, HIPAA requiring 7-year audit logs). Inexpensive blob storage; not queryable via KQL.
Azure Event Hub Streaming integration with external platforms Enables sub-second streaming of log events to external third-party tools such as Splunk, Datadog, Sumo Logic, or Kafka consumers.
Partner Solutions Direct SaaS integration Native Azure marketplace streaming to Datadog or Elastic cloud deployments without intermediate Event Hubs.
Azure CLI Implementation # Configure Diagnostic Setting on Azure Key Vault to route audit logs to Log Analytics and Event Hub
- az monitor diagnostic-settings create \
- -name "diag-keyvault-audit" \
--resource "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-security/providers/Microsoft.KeyVault/vaults/kv-prod-secrets" \
--workspace "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-monitor/providers/Microsoft.OperationalInsights/workspaces/law-central-prod" \
--event-hub "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-monitor/providers/Microsoft.EventHub/namespaces/eh-siem-stream/eventhubs/hub-security-logs" \
--event-hub-rule "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-monitor/providers/Microsoft.EventHub/namespaces/eh-siem-stream/authorizationrules/RootManageSharedAccessKey" \
- -logs '[{"categoryGroup":"audit","enabled":true,"retentionPolicy":{"days":0,"enabled":false}}]' \
- -metrics '[{"category":"AllMetrics","enabled":true,"retentionPolicy":{"days":0,"enabled":false}}]'
- 4. Telemetry Collection Options Matrix
Telemetry Tier Collector Mechanism Ingestion Target Key AZ-400 Exam Scenario
Application Runtime (PaaS / CaaS) Codeless Agent Extension Application Insights Rapid onboarding of existing App Services with zero build-pipeline modifications
Application Code (In-Process) App Insights SDK / OpenTelemetry Application Insights Microservices requiring custom business dimensions, custom metrics, and TelemetryInitializers
Virtual Machine Guest OS Azure Monitor Agent (AMA) + DCR Log Analytics & Metrics Windows/Linux OS event collection with client-side KQL filtering to minimize ingestion billing
VM Process / TCP Topology AMA + Dependency Agent (Map) VM Insights (Service Map) Live network dependency mapping during pre-migration discovery and multi-tier failure triage
Kubernetes Infrastructure & Pods AMA Container Add-on ( ama-logs ) Container Insights / Prometheus AKS cluster capacity monitoring, container stderr/stdout log streaming, and pod crash diagnostics
Azure Platform Resources Diagnostic Settings Log Analytics / Storage / Event Hub Streaming PaaS resource logs to Splunk via Event Hubs or archiving audit logs for 7 years in Blob
- 5. Realistic Exam Scenario & Common Traps
- Scenario: High-Volume Fintech Regulatory Observability
Organization : Global Trade Financial runs an electronic settlement platform comprising 150 Azure VMs, a 20-node AKS cluster, and Azure SQL databases.
Constraint 1 : The internal SOC requires all virtual machine failed authentication attempts (Event ID 4625) and all Azure Key Vault audit events to be analyzed in real time. Informational successful logon events (Event ID 4624) must be excluded at the machine boundary to avoid blowing through their 500 GB/day Log Analytics ingestion quota.
Constraint 2 : Corporate compliance requires all transaction audit logs to be retained for 7 years at minimum financial cost.
Constraint 3 : The site reliability engineering team needs to ingest Prometheus metrics from their payment container pods without managing a dedicated Prometheus cluster.
DevOps Architect Solution :
Deploy the Azure Monitor Agent (AMA) across all virtual machines and bind them to a Data Collection Rule (DCR) with a KQL stream transform: source | where EventID == 4625 . This drops Event 4624 before network transmission, satisfying the ingestion budget.
Configure Diagnostic Settings on the Azure Key Vault and transaction databases targeting an Azure Storage Account with a Lifecycle Management policy transitioning blobs to Cold tier after 30 days and Archive tier after 90 days (7-year retention).
Enable Azure Container Insights on the AKS cluster with managed Prometheus scraping enabled, streaming pod metrics directly into Azure Monitor Managed Service for Prometheus.
Common Exam Traps to Avoid
Trap: Selecting the legacy Log Analytics agent (MMA/OMS) in any design. The legacy agent was retired in August 2024. The correct choice on modern AZ-400 questions is always Azure Monitor Agent (AMA) with Data Collection Rules.
Trap: Selecting Log Analytics storage for 7-year compliance archives. While Log Analytics supports up to 730 days interactive retention and 12-year archive, storing high-volume raw compliance logs in an Azure Storage Account via Diagnostic Settings is drastically cheaper and the standard exam answer for multi-year regulatory retention.
Trap: Choosing codeless auto-instrumentation when custom telemetry properties are required. If a scenario requires tracking custom business metrics or injecting context properties (such as user tenant IDs or checkout transaction dollar values), the answer is always SDK-based instrumentation with custom TelemetryInitializer or TelemetryClient .
Trap: Attempting to stream logs to Splunk or Datadog directly from Log Analytics. Azure resources do not push directly from Log Analytics to third-party SIEMs; instead, configure Diagnostic Settings with an Azure Event Hub destination, which acts as the high-throughput streaming bridge to external SIEM connectors.