This chapter covers Azure Application Insights, a feature of Azure Monitor that provides application performance management (APM) and telemetry for live web applications. For the AZ-900 exam, this topic falls under Domain 3: Azure Management Governance, Objective 3.3: Describe Azure Monitor and its features. Application Insights is a key component that candidates must understand—especially its role in monitoring application behavior, detecting anomalies, and diagnosing issues. This objective area carries approximately 5-10% of the exam weight, and questions often test your ability to distinguish Application Insights from other monitoring tools like Log Analytics or Azure Monitor itself.
Jump to a section
Imagine you own a chain of restaurants. Each restaurant has multiple stations: the grill, the salad bar, the drink station, and the cash register. You need to know not just if a customer complained, but exactly where the delay happened. A health inspector (Application Insights) visits each station, records every action: how long the grill took to cook a burger, how many salads were tossed per minute, how often the drink machine jammed. The inspector doesn't just report 'service was slow'—they give you a detailed timeline: 'At 7:03 PM, the grill took 12 minutes for order #47, which caused a 5-minute wait at the cash register.' The inspector also checks for 'health' issues: if the grill temperature spikes, they flag it as a potential fire hazard (alert). Without this inspector, you'd only know total sales and maybe a few customer complaints—you'd miss the root cause of bottlenecks. Application Insights does the same for your web application: it monitors every request, dependency, exception, and page view, and correlates them into a single 'end-to-end' transaction to pinpoint exactly where performance degrades or errors occur.
What is Application Insights and What Business Problem Does It Solve?
Application Insights is an extension of Azure Monitor that provides application performance management (APM) for live web applications. It automatically detects performance anomalies, includes powerful analytics tools to help you diagnose issues, and helps you understand what users actually do with your app. The core business problem it solves is the 'black box' problem: when a web application goes down or performs poorly, traditional monitoring (like checking server CPU or memory) tells you that something is wrong, but not what caused it. Was it a slow database query? A memory leak in a specific function? A third-party API that timed out? Application Insights gives you end-to-end transaction traces that show the exact path a request took through your application, including all dependencies, with timings and error details.
How It Works – Step by Step Mechanism
Application Insights works by instrumenting your application code with an SDK (Software Development Kit). When you add the SDK to your app, it automatically collects telemetry data such as: - Request rates – how many requests your app receives per second - Response times – how long it takes to process each request - Failure rates – percentage of requests that result in errors - Dependency tracking – calls to databases, external APIs, or other services - Exceptions – detailed stack traces for unhandled exceptions - Page views and load performance (for client-side monitoring) - User and session counts – how many unique users and their sessions
The SDK sends this telemetry to an Application Insights resource in Azure, which stores the data in a time-series database optimized for fast queries. You can then view this data in the Azure portal through pre-built dashboards, charts, and a powerful query language called Kusto Query Language (KQL).
Key Components
Application Map – A visual representation of your application's components and their dependencies. It shows the flow of requests and highlights performance bottlenecks or failures.
Live Metrics – Real-time monitoring of your application's performance with sub-second latency. Useful for verifying a deployment or troubleshooting an active incident.
Availability Tests – Ping tests or multi-step web tests that check if your application is accessible from various geographic locations. You can set alerts for when availability drops below a threshold (e.g., 99.9%).
Smart Detection – Automatic detection of anomalies such as sudden increases in failure rate, slow response times, or memory leaks. It uses machine learning to baseline normal behavior and alerts you only when something unusual occurs.
Profiler – A feature that captures detailed call stacks for slow requests, showing exactly which lines of code consumed the most CPU time.
Snapshot Debugger – Automatically captures a debug snapshot when an exception occurs, allowing you to inspect the state of the application at the moment of failure.
Tiers and Pricing
Application Insights has two pricing models: Pay-as-you-go and Enterprise (now called Application Insights with Log Analytics). The pay-as-you-go model charges based on the volume of data ingested (in GB) and the number of availability test executions. There is a free monthly allowance of 1 GB of data ingested. The Enterprise model (now integrated with Log Analytics) offers unlimited data retention for 90 days and is priced per node. For AZ-900, you don't need to memorize exact prices, but you should know that data ingestion costs are the primary cost driver, and you can control costs by setting sampling rates (e.g., sending only 10% of requests to reduce data volume).
Comparison to On-Premises Equivalent
In an on-premises environment, you might use tools like New Relic, Dynatrace, or open-source APM tools like Jaeger. These tools require you to install agents on servers and configure them manually. With Application Insights, the SDK is integrated into your code, and the backend is fully managed by Azure—no servers to maintain, no scaling to worry about. The telemetry is automatically correlated across multiple servers and regions, which is much harder to achieve on-premises without significant investment.
Azure Portal and CLI Touchpoints
To create an Application Insights resource, you can use the Azure portal:
Navigate to 'Application Insights' under 'Azure Monitor' or search for it.
Click 'Create', provide a name, choose the same region as your application, and select the pricing tier.
Once created, you get an Instrumentation Key (ikey) that you add to your application's configuration.
Using Azure CLI:
az resource create -g MyResourceGroup -n MyAppInsights --resource-type "Microsoft.Insights/components" --properties '{"Application_Type":"web"}'You can also retrieve the instrumentation key:
az resource show -g MyResourceGroup -n MyAppInsights --resource-type "Microsoft.Insights/components" --query properties.InstrumentationKeyConcrete Business Scenarios
E-commerce site: An online retailer uses Application Insights to track page load times. They notice that checkout pages take 5 seconds to load, leading to cart abandonment. With the Profiler, they discover that a third-party payment gateway API call is slow. They switch to a faster provider and reduce load time to 1 second, increasing conversion by 20%.
SaaS application: A SaaS company deploys a new version every week. They use Application Insights' Live Metrics to monitor the deployment in real-time. If the failure rate spikes, they automatically roll back using Azure DevOps deployment gates.
Mobile app backend: A gaming company monitors server-side performance. They use Smart Detection to automatically detect a memory leak that only occurs after 24 hours of uptime, which they would have missed with traditional monitoring.
Create an Application Insights Resource
In the Azure portal, search for 'Application Insights' and click 'Create'. You need to provide a name, select the subscription, resource group, and region (choose the same region as your application to minimize latency). Choose the 'Workspace-based' option (recommended) to store telemetry in a Log Analytics workspace, which enables cross-resource queries. Once created, note the Instrumentation Key (ikey) from the 'Overview' blade—this is the unique identifier your application uses to send telemetry. You can also create it via CLI or ARM template.
Instrument Your Application with SDK
Add the Application Insights SDK to your application code. For .NET, you install the `Microsoft.ApplicationInsights.AspNetCore` NuGet package and add `services.AddApplicationInsightsTelemetry(Configuration["ApplicationInsights:InstrumentationKey"]);` in Startup.cs. For Java, add the agent JAR and set the ikey as an environment variable. For Node.js, install the `applicationinsights` npm package and call `appInsights.setup(ikey).start()`. The SDK automatically collects HTTP requests, dependencies, exceptions, and custom events. You can also add custom telemetry for business-specific metrics.
Configure Availability Tests
In the Application Insights resource, go to 'Availability' and create a 'Standard test' (ping test) or 'Multi-step test' (for complex scenarios like login flows). Set the test frequency (e.g., every 5 minutes) and the test locations (e.g., US East, West Europe). Azure will send HTTP requests from those locations to your app's URL. You can set alert rules to notify you if the availability drops below a threshold (e.g., 99% success rate). Availability tests count against your data ingestion quota, so monitor usage.
Analyze Telemetry with Application Map
The Application Map visualizes all components of your application and their dependencies. Open the 'Application Map' blade in the portal. It shows nodes for each service (e.g., web app, database, external API) and edges with average response times and failure rates. Click on a node to see details like request count, failed requests, and performance metrics. The map auto-updates as new telemetry arrives. Use it to quickly identify which component is causing a bottleneck. For example, if the database node shows high latency, you can drill into SQL queries.
Use Live Metrics for Real-Time Debugging
During a deployment or incident, open 'Live Metrics' in the portal. It shows real-time telemetry with sub-second latency: request rate, response time, failure rate, and custom events. You can filter by specific properties (e.g., server name, user ID). This is useful for verifying that a fix is working or that a new deployment isn't causing errors. Live Metrics does not incur data ingestion costs because it streams data directly without storage. However, it only shows data while the blade is open.
Scenario 1: E-commerce Platform Performance Optimization
A mid-sized e-commerce company runs a .NET Core web application on Azure App Service. They notice that during peak hours (7-9 PM), page load times increase from 2 seconds to 8 seconds, leading to a 15% drop in checkout completion. They implement Application Insights by adding the SDK to their code and creating an Application Insights resource. They configure availability tests from three global locations. Within hours, the Application Map reveals that a third-party inventory API is the bottleneck: it takes 5 seconds to respond. They also use the Profiler to capture a 10-second request and find that a serialization process in their code is inefficient. They optimize the serialization and implement caching for the inventory API. After deployment, Live Metrics shows response times drop to 1.5 seconds. They also set up Smart Detection alerts for any future anomaly. Cost considerations: they ingest about 2 GB of data per month, staying within the free tier (1 GB) plus a small overage. If they had not optimized, they would have lost $50,000 in revenue per month.
Scenario 2: SaaS Application Continuous Deployment Monitoring
A SaaS startup with a Node.js backend uses Azure Kubernetes Service (AKS). They deploy updates twice a week. They use Application Insights to monitor deployments by enabling Live Metrics during rollout. One deployment causes a 10% increase in 500 errors. The team sees the spike in Live Metrics immediately and rolls back using Azure DevOps. They then use Snapshot Debugger to capture a snapshot of the exception—it reveals a null reference in a new feature. They fix it and redeploy. Without Application Insights, they would have discovered the issue only after customer complaints. They also use Application Map to track microservice dependencies and ensure no new service introduces latency.
Scenario 3: Mobile Game Backend
A gaming company uses Azure Functions for serverless game logic. They instrument their functions with the Application Insights SDK. They track custom events for player actions (e.g., 'level_completed', 'purchase'). They discover that a specific function (awarding points) has a high failure rate when called concurrently. Using the Profiler, they find a race condition in the database code. They fix it and see failure rates drop to zero. They also use availability tests to ensure the game API is reachable from multiple regions. Without Application Insights, they would have struggled to reproduce the race condition because it only occurs under load.
What AZ-900 Tests on This Objective
Domain 3: Azure Management Governance, Objective 3.3: Describe Azure Monitor and its features. Specifically, you need to know:
Application Insights is a feature of Azure Monitor for application performance management (APM).
It monitors live web applications, detects anomalies, and provides diagnostics.
Key capabilities: request tracking, dependency tracking, exception tracking, availability tests, live metrics, profiler, snapshot debugger, and smart detection.
It uses an SDK to instrument applications and sends telemetry to an Azure resource.
It can be used for both server-side and client-side monitoring (via JavaScript SDK).
Integration with Log Analytics for advanced queries.
Common Wrong Answers and Why Candidates Choose Them
'Application Insights is a separate service from Azure Monitor.' – Wrong. Application Insights is part of Azure Monitor. Candidates confuse it because it has its own blade in the portal, but it's a feature.
'Application Insights only monitors Azure VMs.' – Wrong. It monitors applications, not VMs. It can monitor apps running anywhere (on-premises, other clouds) as long as they can send telemetry to Azure.
'Application Insights is used for infrastructure monitoring like CPU and memory.' – Wrong. That's Azure Monitor metrics. Application Insights focuses on application performance (requests, dependencies, exceptions).
'Application Insights requires agents to be installed on servers.' – Wrong. It uses SDKs in the application code, not agents (though there is a separate agent for .NET on-premises apps called the Application Insights Agent).
Specific Terms and Values
Instrumentation Key (ikey) – the unique identifier for an Application Insights resource.
Sampling – technique to reduce data volume (e.g., fixed-rate sampling at 10%).
Availability test types: Standard (ping) and Multi-step.
Smart Detection – automatic anomaly detection using machine learning.
Profiler – captures call stacks for slow requests.
Snapshot Debugger – captures debug snapshots on exceptions.
Edge Cases
Application Insights can monitor apps not hosted in Azure (e.g., on-premises, AWS). The exam may test that it's not limited to Azure.
You can have multiple Application Insights resources for different environments (dev, test, prod).
If you stop sending telemetry, the resource still exists but shows no data.
Memory Trick
Think 'APM' = Application Performance Monitoring, which is exactly what Application Insights does. If the question is about monitoring an application's behavior (requests, dependencies, exceptions), the answer is Application Insights. If it's about monitoring the infrastructure (CPU, memory, disk), the answer is Azure Monitor Metrics or Log Analytics.
Application Insights is a feature of Azure Monitor for application performance management (APM).
It uses an SDK to instrument applications and sends telemetry to an Azure resource identified by an Instrumentation Key (ikey).
Key capabilities: request tracking, dependency tracking, exception tracking, availability tests, live metrics, profiler, snapshot debugger, and smart detection.
It can monitor applications running anywhere (Azure, on-premises, other clouds).
Data retention is 90 days by default; pricing is based on data ingested (free 1 GB/month).
Smart Detection uses machine learning to automatically detect anomalies like failure rate spikes or slow response times.
Availability tests verify application uptime from multiple global locations.
The Profiler captures detailed call stacks for slow requests, and Snapshot Debugger captures debug snapshots on exceptions.
These come up on the exam all the time. Here's how to tell them apart.
Application Insights
Focuses on application performance (APM)
Uses SDK instrumentation in code
Provides pre-built dashboards for requests, dependencies, exceptions
Automatically correlates telemetry into end-to-end transactions
Includes Smart Detection, Profiler, and Snapshot Debugger
Log Analytics
Focuses on log and metric data from various Azure resources
Collects data from agents, diagnostics settings, and APIs
Requires Kusto Query Language (KQL) to create custom queries
Does not automatically correlate across resources; you write queries
Used for general-purpose log analysis and alerting
Mistake
Application Insights can only monitor Azure-hosted applications.
Correct
Application Insights can monitor any application that can send HTTP telemetry to Azure, including on-premises, other clouds, or even mobile devices via the SDK.
Mistake
Application Insights is the same as Azure Monitor.
Correct
Application Insights is a feature of Azure Monitor, not a separate service. Azure Monitor is the overarching platform for monitoring Azure resources, while Application Insights focuses on application performance.
Mistake
Application Insights requires no code changes to work.
Correct
You must instrument your application with the SDK (code change) to collect telemetry. There is an auto-instrumentation option for .NET and Java, but it still requires configuration.
Mistake
Application Insights only monitors server-side performance.
Correct
It also monitors client-side performance via the JavaScript SDK, including page load times, AJAX calls, and user counts.
Mistake
Application Insights data is stored indefinitely by default.
Correct
Data retention is 90 days for most data (default). You can adjust retention to a maximum of 730 days, but that incurs additional costs.
Azure Monitor is the overarching platform for monitoring Azure resources, including metrics, logs, and alerts. Application Insights is a specific feature of Azure Monitor that focuses on application performance monitoring (APM). While Azure Monitor collects infrastructure-level data (CPU, memory, disk), Application Insights collects application-level telemetry (requests, dependencies, exceptions). Think of Azure Monitor as the entire dashboard, and Application Insights as a specialized gauge for your app's health.
Yes, typically you need to add the Application Insights SDK to your application code. This is a code change that enables automatic collection of telemetry. For some languages (e.g., .NET, Java), there is an auto-instrumentation option that requires no code changes, but you still need to configure the instrumentation key. For the exam, know that instrumentation is required.
Yes. Application Insights can monitor any application that can send telemetry to Azure, regardless of where it is hosted. You just need to configure the instrumentation key to point to your Application Insights resource. This is a common exam point: Application Insights is not limited to Azure-hosted apps.
The Instrumentation Key (ikey) is a unique GUID that identifies your Application Insights resource. Your application includes this key in every telemetry data packet so that Azure knows which resource to send the data to. You can find the ikey in the Overview blade of your Application Insights resource. It's like a mailbox number for your app's telemetry.
Application Insights provides several debugging tools: the Profiler captures detailed call stacks for slow requests, showing exactly which lines of code consumed CPU time. The Snapshot Debugger captures a debug snapshot when an exception occurs, so you can inspect the application state at the moment of failure. Live Metrics shows real-time telemetry, useful during deployments. These tools help you identify root causes quickly.
Smart Detection is a feature that automatically detects anomalies in your application's telemetry using machine learning. It analyzes historical patterns and alerts you when something unusual happens, such as a sudden spike in failure rate, slow response times, or memory leaks. It reduces alert fatigue by only notifying you about genuine anomalies.
The main cost driver is data ingestion volume. You can reduce costs by enabling sampling (e.g., send only 10% of telemetry), setting daily caps, and adjusting data retention (default 90 days). Also, use Live Metrics sparingly as it does not incur ingestion costs but still consumes bandwidth. The free tier includes 1 GB of data per month.
You've just covered Azure Application Insights — now see how well it sticks with free AZ-900 practice questions. Full explanations included, no account needed.
Done with this chapter?