Courseiva
Implement an instrumentation strategymediumMultiple ChoiceObjective-mapped

AZ-400 Implement an instrumentation strategy Practice Question

You are deploying a Java application to Azure App Service using Azure Pipelines. You want to automatically capture JVM metrics (heap usage, garbage collection) and correlate them with deployment events. What should you do?

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

Enable Application Insights Java agent in the App Service.

The Application Insights Java agent automatically captures JVM metrics such as heap usage and garbage collection, and it integrates with Azure Pipelines to correlate deployment events with these metrics. Option A is incorrect because Azure Monitor diagnostic settings capture Azure platform logs, not application-level JVM metrics. Option C is incorrect because the Visual Studio profiler is designed for local or development debugging, not for automatic production monitoring. Option D is incorrect because diagnostic logs for stdout/stderr capture application output, not JVM internals.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Use Azure Monitor diagnostic settings for the App Service.

    Why it's wrong here

    Azure Monitor diagnostic settings for App Service capture platform-level logs such as resource health, audit logs, and App Service console logs, but they do not expose JVM-internal telemetry like heap usage, garbage collection, or thread states, so they are not the right tool for Java runtime metrics.

  • Enable Application Insights Java agent in the App Service.

    Why this is correct

    The Application Insights Java agent (javaagent) attaches to the JVM at startup and automatically collects JVM metrics such as heap memory, GC pauses, thread count, and class loading, along with distributed traces and custom telemetry, making it the correct and minimally invasive approach for monitoring a Java app on App Service.

  • Attach a profiler from Visual Studio to the App Service process.

    Why it's wrong here

    Attaching a profiler from Visual Studio targets .NET processes and is not designed for Java; even a Java-compatible profiler would require interactive debugging sessions, agent installation, and significant overhead, which is impractical and unsafe for a production App Service environment.

  • Configure App Service diagnostic logs to capture stdout/stderr.

    Why it's wrong here

    Diagnostic logs for stdout/stderr capture application prints, exception traces, and console output, but they require the application to explicitly write JVM-related data; they cannot directly observe JVM heap, GC, or thread performance, so they miss the internals needed for this monitoring requirement.

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 →

How Courseiva writes practice questions · Editorial policy

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.