An administrator needs to monitor access requests to an Azure Key Vault named KV1. The administrator must write a Kusto Query Language (KQL) query in a Log Analytics workspace to identify all key retrieval operations that resulted in an HTTP status code of 401 (Unauthorized) within the past 24 hours. The administrator also needs to ensure that KV1 is configured to send the necessary log data to the workspace.
Which of the following actions or query fragments must be implemented to achieve this goal? (Select TWO)
- Write the following query fragment:
kql
AzureDiagnostics
| where TimeGenerated > ago(24h)
| where ResourceProvider == "MICROSOFT.KEYVAULT"
| where OperationName == "KeyGet" and ResultSignature == "401"
Answer - Configure a diagnostic setting on KV1 to send the AuditEvent log category to the Log Analytics workspace.Answer
- CWrite the following query fragment:
kql
AzureDiagnostics
| where TimeGenerated > ago(24h)
| where ResourceProvider == "MICROSOFT.KEYVAULT"
| filter OperationName == "KeyGet" and ResultSignature == 401 - DConfigure a diagnostic setting on KV1 to send only the AllMetrics metric category to the Log Analytics workspace.
- ECreate an Azure Monitor alert rule with an action group that contains only an empty email notification contact list.
Answer
To achieve the monitoring goal, the administrator must configure a diagnostic setting on the Key Vault to forward the AuditEvent log category to the Log Analytics workspace, and run a KQL query on the AzureDiagnostics table filtering by the Key Vault ResourceProvider, the KeyGet OperationName, and a string-matched ResultSignature of "401" within the past 24 hours.
The correct actions require first establishing the data pipeline by configuring the Key Vault diagnostic settings to send AuditEvent logs to the Log Analytics workspace. Once routed, the data is queryable in the AzureDiagnostics table. The correct KQL query uses the 'where' operator to filter by the MICROSOFT.KEYVAULT ResourceProvider, the KeyGet OperationName, and compares the ResultSignature column against the string value "401" within the past 24 hours.
Step-by-Step Solution
Key Concept
Log Analytics Workspace data routing via Diagnostic Settings and parsing structured logs using valid Kusto Query Language (KQL) syntax, operators, and schemas.