Courseiva
Monitor and Maintain Azure ResourceseasyMultiple ChoiceObjective-mapped

AZ-104 Monitor and Maintain Azure Resources Practice Question

A security admin wants Key Vault audit logs and metrics sent to a Log Analytics workspace for later search. Which Azure setting should be configured on the vault?

⚠ Common exam trap

It's easy for candidates to confuse diagnostic settings (which export logs/metrics) with action groups (which send notifications) or Azure Policy (which enforces rules), leading them to select a wrong option that does not actually stream data to Log Analytics.

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

Diagnostic settings

Diagnostic settings in Azure Key Vault allow you to stream platform logs and metrics to various destinations, including a Log Analytics workspace. By configuring diagnostic settings on the vault, you can send audit logs (e.g., AuditEvent) and metrics (e.g., ServiceApiLatency) to Log Analytics for querying with KQL, enabling security analysis and monitoring.

Answer analysis

Option-by-option breakdown

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

  • Diagnostic settings

    Why this is correct

    Diagnostic settings are the correct mechanism for sending Key Vault audit logs and metrics to Log Analytics, Event Hubs, or Azure Storage. A diagnostic setting on a Key Vault collects resource logs such as AuditEvent (e.g., successful and failed read/write operations) and platform metrics, then routes them continuously to the configured destination. This is the only option in the list that actually exports telemetry data; without a diagnostic setting, Log Analytics receives no Key Vault logging data.

  • Azure Policy assignment

    Why it's wrong here

    Azure Policy assignment enforces compliance and governance by evaluating resource properties against definitions, applying effects such as deny, audit, or deployIfNotExists. A policy assignment can audit whether diagnostic settings are configured on a Key Vault or even deploy one via DeployIfNotExists, but the policy itself does not transport logs or metrics. The actual data flow still relies exclusively on the diagnostic settings, which makes the policy assignment only a controller, not a destination or conduit for audit logs.

    When this WOULD be correct

    A question asks: 'You need to ensure that all Key Vaults in a subscription have auditing enabled. Which Azure feature should you use?' In that scenario, Azure Policy assignment would be correct to enforce diagnostic settings across vaults.

  • Network security group

    Why it's wrong here

    A network security group (NSG) filters IP traffic to and from subnets and network interfaces using security rules; it has no ability to read or transmit Key Vault resource logs or platform metrics. Although NSG flow logs exist, those logs capture allowed/denied network traffic and are a different telemetry stream than Key Vault's audit logs. Key Vault logging is generated at the resource plane and requires diagnostic settings, not NSG configuration, so this option is incorrect.

    When this WOULD be correct

    A scenario where a virtual machine's network traffic needs to be restricted to specific IP addresses or ports. In that case, configuring an NSG on the VM's subnet or NIC would be the correct answer.

  • Action group

    Why it's wrong here

    An action group does not collect or export audit data; it is a notification and response automation mechanism. When an alert fires (e.g., from a metric or Log Analytics log query), the action group performs actions such as sending email/SMS, invoking a webhook, or notifying ITSM tools. Even if the action group is linked to a Log Analytics workspace, it only reacts to processed alerts, not to the underlying Key Vault logs or metrics, so it cannot fulfill the requirement to send audit logs and metrics.

    When this WOULD be correct

    An action group would be correct if the question asked: 'Which Azure setting should be configured to send an email alert when Key Vault audit logs exceed a certain threshold?'

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.

Diagnostic settingsCorrect answer

Why this is correct

Diagnostic settings are the correct mechanism for sending Key Vault audit logs and metrics to Log Analytics, Event Hubs, or Azure Storage. A diagnostic setting on a Key Vault collects resource logs such as AuditEvent (e.g., successful and failed read/write operations) and platform metrics, then routes them continuously to the configured destination. This is the only option in the list that actually exports telemetry data; without a diagnostic setting, Log Analytics receives no Key Vault logging data.

Azure Policy assignmentWrong answer — click to see why

Why this is wrong here

Azure Policy assignment enforces compliance rules across resources, but it does not configure data routing for logs and metrics. Diagnostic settings are the specific feature for sending Key Vault audit logs and metrics to a Log Analytics workspace.

★ When this WOULD be the correct answer

A question asks: 'You need to ensure that all Key Vaults in a subscription have auditing enabled. Which Azure feature should you use?' In that scenario, Azure Policy assignment would be correct to enforce diagnostic settings across vaults.

Why candidates choose this

Candidates may confuse policy enforcement with direct configuration, thinking that assigning a policy can itself route logs, rather than understanding that policy only ensures the diagnostic setting exists.

Network security groupWrong answer — click to see why

Why this is wrong here

Network security groups (NSGs) filter network traffic to/from Azure resources, but they do not collect or route audit logs or metrics to Log Analytics. Diagnostic settings are the correct mechanism for sending Key Vault logs and metrics to a Log Analytics workspace.

★ When this WOULD be the correct answer

A scenario where a virtual machine's network traffic needs to be restricted to specific IP addresses or ports. In that case, configuring an NSG on the VM's subnet or NIC would be the correct answer.

Why candidates choose this

Candidates may confuse network-level security controls (NSGs) with monitoring and logging configurations, assuming that securing network access also enables log collection.

Action groupWrong answer — click to see why

Why this is wrong here

Action groups define notifications and actions (e.g., email, SMS) triggered by alerts, but they do not configure the collection or routing of logs and metrics to a Log Analytics workspace.

★ When this WOULD be the correct answer

An action group would be correct if the question asked: 'Which Azure setting should be configured to send an email alert when Key Vault audit logs exceed a certain threshold?'

Why candidates choose this

Candidates may confuse action groups with diagnostic settings because both involve monitoring and alerts, leading them to think action groups can also route logs to Log Analytics.

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

Courseiva writes every AZ-104 question from scratch — 1,049 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or 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-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.