AZ-400 Implement an instrumentation strategy Practice Question
A company deploys a .NET Core web application to Azure App Service. The application uses Application Insights for monitoring. The operations team reports that dependency tracking is missing for calls to a third-party REST API made using HttpClient. The application is instrumented with the Application Insights SDK. Which action should be taken to enable dependency tracking for HttpClient calls?
⚠ Common exam trap
Many exam-takers confuse the .NET Core SDK approach with legacy .NET Framework tools like Status Monitor or manual `DependencyTrackingModule.Initialize()`, assuming dependency tracking requires extra packages or agent installation, when in fact `AddApplicationInsightsTelemetry()` handles it automatically for .NET Core.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Ensure the SDK is configured using services.AddApplicationInsightsTelemetry(); in the Startup.cs file.
`services.AddApplicationInsightsTelemetry()` in `Startup.cs` automatically registers the `DependencyTrackingModule` for .NET Core applications. This module collects dependency telemetry for `HttpClient` calls made via `IHttpClientFactory` or typed `HttpClient` instances, provided the SDK is properly configured. Since the application already uses the Application Insights SDK, this single line enables automatic dependency tracking without additional packages or agents.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Ensure the SDK is configured using services.AddApplicationInsightsTelemetry(); in the Startup.cs file.
Why this is correct
In ASP.NET Core, calling services.AddApplicationInsightsTelemetry() in the Startup.ConfigureServices method registers all Application Insights services with the built-in dependency injection container. This extension automatically initializes the DependencyTrackingModule, enabling outbound dependency calls (such as HttpClient) to be tracked without writing any additional initialization code, and it reads the instrumentation key or connection string from app settings.
- ✗
Install the Application Insights Agent on the App Service instance.
Why it's wrong here
The Application Insights Agent is a codeless attach option primarily for .NET Framework or IIS-hosted apps; when the Application Insights SDK is already added via AddApplicationInsightsTelemetry(), installing the Agent is redundant and unnecessary for dependency tracking in a .NET Core App Service.
- ✗
Add a reference to Microsoft.ApplicationInsights.DependencyCollector and call DependencyTrackingModule.Initialize().
Why it's wrong here
Manually adding Microsoft.ApplicationInsights.DependencyCollector and invoking DependencyTrackingModule.Initialize() is a low-level invocation intended for custom bootstrapping when you are not using the standard AddApplicationInsightsTelemetry() extension. Because AddApplicationInsightsTelemetry() already registers and initializes the dependency collector as part of its default pipeline, performing an explicit Initialize() afterward is redundant and can cause duplicate dependency telemetry or double initialization. In an Azure App Service with the SDK already configured, this manual step adds risk without contributing any additional tracking capability.
- ✗
Use the Application Insights Status Monitor to enable dependency tracking.
Why it's wrong here
Application Insights Status Monitor is a legacy on-premises tool for instrumenting .NET Framework applications by attaching to IIS or modifying web.config; it is not used for .NET Core applications running on Azure App Service, where the SDK is the proper way to enable dependency tracking.
Go deeper
Related to this question
Learn chapter
Introduction to DevOps and Azure DevOps
Key term
Telemetry
Telemetry is the automatic collection, transmission, and measurement of data from remote sources to a central system for analysis and monitoring.
Key term
Application Insights
Application Insights is an Azure monitoring service that helps developers detect, diagnose, and understand issues in live web applications by collecting telemetry data like requests, exceptions, and performance counters.
About these practice questions
This AZ-400 question is part of Courseiva's 823-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This AZ-400 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AZ-400 exam.