AZ-104 Monitor and Maintain Azure Resources Practice Question
This AZ-104 practice question tests your understanding of monitor and maintain azure resources. Read the scenario carefully and evaluate each option against the stated constraints before committing to an answer. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.
Exhibit
Workspace: law-prod
Table: Heartbeat
Sample records
--------------
TimeGenerated Computer ResourceId
2026-04-26T10:00:00Z VM01 /subscriptions/111/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/VM01
2026-04-26T10:01:00Z VM01 /subscriptions/111/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/VM01
2026-04-26T10:02:00Z VM02 /subscriptions/111/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/VM02
2026-04-26T10:03:00Z VM02 /subscriptions/111/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/VM02
Requirement
-----------
Alert if a VM has no heartbeat for 15 minutes.
Based on the exhibit, the operations team wants an alert that fires when any VM has not sent a heartbeat in the last 15 minutes. Which KQL query should they use as the condition for the log alert?
Workspace: law-prod
Table: Heartbeat
Sample records
--------------
TimeGenerated Computer ResourceId
2026-04-26T10:00:00Z VM01 /subscriptions/111/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/VM01
2026-04-26T10:01:00Z VM01 /subscriptions/111/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/VM01
2026-04-26T10:02:00Z VM02 /subscriptions/111/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/VM02
2026-04-26T10:03:00Z VM02 /subscriptions/111/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/VM02
Requirement
-----------
Alert if a VM has no heartbeat for 15 minutes.
A
Heartbeat | summarize LastSeen=max(TimeGenerated) by Computer | where LastSeen > ago(15m)
Why wrong: This query finds machines that have been seen recently, which is the opposite of the requested outage condition.
B
Heartbeat | summarize LastSeen=max(TimeGenerated) by Computer | where LastSeen < ago(15m)
This query summarizes the most recent heartbeat per computer and then filters for systems whose latest record is older than 15 minutes. That matches the requirement to alert when a VM has stopped sending heartbeat data.
C
Heartbeat | where TimeGenerated > ago(15m) | summarize count() by Computer | where count() == 0
Why wrong: Filtering to the last 15 minutes first removes older data, so the count cannot prove absence of records for a VM in the needed way.
D
Heartbeat | distinct Computer | where Computer == "VM01"
Why wrong: This only lists a computer name if it appears in the table. It does not detect that the last heartbeat was older than 15 minutes.
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Heartbeat | summarize LastSeen=max(TimeGenerated) by Computer | where LastSeen < ago(15m)
Option B is correct because the query uses `summarize max(TimeGenerated) by Computer` to get the latest heartbeat timestamp per VM, then filters with `where LastSeen < ago(15m)` to identify VMs whose last heartbeat is older than 15 minutes. This directly matches the alert condition: any VM that has not sent a heartbeat in the last 15 minutes.
Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
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 | summarize LastSeen=max(TimeGenerated) by Computer | where LastSeen > ago(15m)
Why it's wrong here
This query finds machines that have been seen recently, which is the opposite of the requested outage condition.
✓
Heartbeat | summarize LastSeen=max(TimeGenerated) by Computer | where LastSeen < ago(15m)
Why this is correct
This query summarizes the most recent heartbeat per computer and then filters for systems whose latest record is older than 15 minutes. That matches the requirement to alert when a VM has stopped sending heartbeat data.
Related concept
Read the scenario before looking for a memorised answer.
✗
Heartbeat | where TimeGenerated > ago(15m) | summarize count() by Computer | where count() == 0
Why it's wrong here
Filtering to the last 15 minutes first removes older data, so the count cannot prove absence of records for a VM in the needed way.
✗
Heartbeat | distinct Computer | where Computer == "VM01"
Why it's wrong here
This only lists a computer name if it appears in the table. It does not detect that the last heartbeat was older than 15 minutes.
Common exam traps
Common exam trap: answer the scenario, not the keyword
The trap here is that candidates often confuse the direction of the time comparison, picking Option A (which fires on VMs that *have* sent a heartbeat recently) instead of Option B (which fires on VMs that have *not* sent a heartbeat recently).
Detailed technical explanation
How to think about this question
The `Heartbeat` table in Azure Monitor collects agent heartbeats every 5 minutes by default for Azure VMs with the Log Analytics agent. Using `max(TimeGenerated)` per computer gives the most recent heartbeat, and comparing it to `ago(15m)` (a KQL time literal) effectively checks for a gap of three missed heartbeat intervals. This pattern is commonly used for 'heartbeat failure' alerts and must account for time zone normalization (all timestamps are UTC).
KKey Concepts to Remember
Read the scenario before looking for a memorised answer.
Find the constraint that changes the correct option.
Eliminate answers that are true in general but not in this case.
TExam Day Tips
→Watch for words such as best, first, most likely and least administrative effort.
→Review why wrong options are wrong, not only why the correct option is correct.
Key takeaway
Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Real-world example
How this comes up in practice
An e-commerce site experiences heavy traffic on Black Friday and near-zero traffic during off-peak weeks. Rather than provisioning permanent large VMs, the team uses auto-scaling groups that add capacity automatically under load and reduce it overnight. Questions like this test whether you understand elasticity, availability zones, and cloud compute scaling patterns.
Related glossary terms
Concepts from this question explained
These glossary pages explain the core terms tested in this AZ-104 question in full detail.
Monitor and Maintain Azure Resources — This question tests Monitor and Maintain Azure Resources — Read the scenario before looking for a memorised answer..
What is the correct answer to this question?
The correct answer is: Heartbeat | summarize LastSeen=max(TimeGenerated) by Computer | where LastSeen < ago(15m) — Option B is correct because the query uses `summarize max(TimeGenerated) by Computer` to get the latest heartbeat timestamp per VM, then filters with `where LastSeen < ago(15m)` to identify VMs whose last heartbeat is older than 15 minutes. This directly matches the alert condition: any VM that has not sent a heartbeat in the last 15 minutes.
What should I do if I get this AZ-104 question wrong?
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
What is the key concept behind this question?
Read the scenario before looking for a memorised answer.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
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.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.