Courseiva

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?

⚠ Common exam trap

AZ-400 often tests the distinction between platform-level monitoring and application-level APM; candidates may choose Azure Monitor diagnostic settings or stdout logs, missing the need for JVM-specific instrumentation.

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.

To automatically capture JVM metrics (heap usage, garbage collection) and correlate them with deployment events, you should enable the Application Insights Java agent in the App Service. The Java agent auto-instruments the JVM, collecting detailed metrics and telemetry without code changes. Application Insights integrates with Azure Pipelines, allowing deployment annotations to be correlated with telemetry.

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 696-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 and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official Microsoft exam blueprint

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.