Courseiva
Monitor and Maintain Azure ResourceseasyMultiple ChoiceObjective-mapped

AZ-104 Monitor and Maintain Azure Resources Practice Question

A VM named VM01 stopped sending Heartbeat records to Log Analytics 15 minutes ago. Which KQL query should you run to confirm the VM's recent heartbeat entries?

⚠ Common exam trap

Watch out — candidates often confuse the Heartbeat table (agent health) with AzureActivity (resource operations) or Perf (performance metrics), assuming any log data can confirm agent connectivity, but only Heartbeat provides the direct, time-stamped signal of agent liveness.

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

Heartbeat | where Computer == "VM01" and TimeGenerated > ago(15m)

The Heartbeat table in Log Analytics stores records sent by the Azure Monitor Agent (AMA) or Log Analytics agent every 5 minutes by default. Querying Heartbeat with a filter for Computer == 'VM01' and TimeGenerated > ago(15m) directly checks if any heartbeat records were generated in the last 15 minutes, confirming whether the VM is still reporting. This is the correct approach because Heartbeat is the dedicated table for agent health, and the time filter matches the 15-minute window specified in the question.

Answer analysis

Option-by-option breakdown

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

  • Heartbeat | where Computer == "VM01" and TimeGenerated > ago(15m)

    Why this is correct

    This query correctly queries the Heartbeat table, which is the dedicated Log Analytics table for agent health signals. The Heartbeat table is populated with a record from VM01 every minute by the Log Analytics agent, and the filter `TimeGenerated > ago(15m)` restricts results to records ingested in the last 15 minutes. If no rows are returned, it indicates that the agent on VM01 has stopped sending heartbeats, confirming the reported issue. The `Computer == "VM01"` filter ensures you isolate that specific virtual machine from other agents reporting to the same workspace.

  • AzureActivity | where ResourceProviderValue == "Microsoft.Compute/virtualMachines"

    Why it's wrong here

    The AzureActivity table contains Azure Resource Manager control-plane operation logs (e.g., create, start, stop, restart of a VM), not the telemetry data that the Log Analytics agent sends to the workspace. Filtering by `ResourceProviderValue == "Microsoft.Compute/virtualMachines"` would return administrative events like 'write Microsoft.Compute/virtualMachines/deallocate/action' or resource health status changes, but it will never contain heartbeat records. Heartbeat data is stored in the Log Analytics 'Heartbeat' table, which is populated by the agent every minute; therefore this query cannot diagnose whether the agent is still reporting. Even if a VM is operationally healthy, its heartbeat may be stopped, and only the Heartbeat table reveals that.

    When this WOULD be correct

    This query would be correct if the question asked: 'Which KQL query lists all recent Azure Resource Manager operations for a specific virtual machine?'

  • Heartbeat | summarize count() by Computer

    Why it's wrong here

    This query aggregates heartbeat counts per computer across the entire retention period of the workspace, with no time-bound filter such as `TimeGenerated > ago(15m)`. As a result, a VM that stopped sending heartbeats hours, days, or even weeks ago would still appear in the output with a high count, because the summarize counts all historical records. Additionally, this query does not filter to VM01, so it would return counts for every monitored machine, making it impossible to isolate the specific VM in question. To detect a stopped heartbeat, you need a time-filtered query that checks for absence of recent records, not historical totals.

    When this WOULD be correct

    This query would be correct for a question asking: 'Which KQL query shows the total number of heartbeat records per computer over the entire retention period?'

  • Perf | where CounterName == "% Processor Time"

    Why it's wrong here

    The Perf table stores performance counter samples (e.g., CPU, memory, disk I/O) collected from the agent, not the agent's heartbeat signal. Filtering by `CounterName == "% Processor Time"` would show CPU-utilization percentages for all computers, but it does not indicate whether the Log Analytics agent is alive or has stopped reporting. A VM may have zero recent performance records because the agent is down, but you cannot distinguish that from a lack of performance collection without cross-referencing the Heartbeat table. Moreover, this query does not filter to VM01 and would return performance data from every monitored machine, further obscuring the specific agent-health issue.

    When this WOULD be correct

    This query would be correct if the question asked: 'Which KQL query identifies a VM with high CPU usage in the last 15 minutes?' or 'Which query checks recent CPU performance for VM01?'

Option-by-option analysis

Why each answer is right or wrong

Understanding why wrong answers are wrong — and when they would be correct — is what separates a 750 score from a 900. The AZ-104 exam frequently reuses these exact scenarios with slightly different constraints.

Heartbeat | where Computer == "VM01" and TimeGenerated > ago(15m)Correct answer

Why this is correct

This query correctly queries the Heartbeat table, which is the dedicated Log Analytics table for agent health signals. The Heartbeat table is populated with a record from VM01 every minute by the Log Analytics agent, and the filter `TimeGenerated > ago(15m)` restricts results to records ingested in the last 15 minutes. If no rows are returned, it indicates that the agent on VM01 has stopped sending heartbeats, confirming the reported issue. The `Computer == "VM01"` filter ensures you isolate that specific virtual machine from other agents reporting to the same workspace.

AzureActivity | where ResourceProviderValue == "Microsoft.Compute/virtualMachines"Wrong answer — click to see why

Why this is wrong here

AzureActivity logs Azure Resource Manager operations, not VM heartbeat data. To confirm recent heartbeat entries, you need to query the Heartbeat table with a time filter, not AzureActivity.

★ When this WOULD be the correct answer

This query would be correct if the question asked: 'Which KQL query lists all recent Azure Resource Manager operations for a specific virtual machine?'

Why candidates choose this

Candidates may confuse AzureActivity with VM health monitoring, thinking that resource provider operations include heartbeat data, or they may not know that Heartbeat is a separate table in Log Analytics.

Heartbeat | summarize count() by ComputerWrong answer — click to see why

Why this is wrong here

This query summarizes heartbeat counts per computer but does not filter by VM01 or time range, so it cannot confirm recent heartbeat entries for a specific VM.

★ When this WOULD be the correct answer

This query would be correct for a question asking: 'Which KQL query shows the total number of heartbeat records per computer over the entire retention period?'

Why candidates choose this

Candidates may think summarizing counts is a quick way to see activity, but they overlook the need to filter by computer and time to check recent heartbeats.

Perf | where CounterName == "% Processor Time"Wrong answer — click to see why

Why this is wrong here

The Perf table tracks performance counters like CPU usage, not heartbeat records. The question specifically asks for heartbeat entries, so querying '% Processor Time' cannot confirm heartbeat status.

★ When this WOULD be the correct answer

This query would be correct if the question asked: 'Which KQL query identifies a VM with high CPU usage in the last 15 minutes?' or 'Which query checks recent CPU performance for VM01?'

Why candidates choose this

Candidates may confuse performance monitoring with health monitoring, assuming CPU metrics indicate VM responsiveness, or they might think any recent data from the VM suffices to confirm heartbeat activity.

Analysis generated from the official AZ-104blueprint and verified against question context. The “when correct” sections are what AI assistants cite when candidates ask “what’s the difference between these options?”

About these practice questions

One of 1,049 original AZ-104 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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-104 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-104 exam.