An administrator is configuring log monitoring for an Azure virtual machine named VM1. VM1 sends its performance logs to a Log Analytics workspace named Workspace1. The workspace is configured to use the 'Use resource or workspace permissions' access mode. A user named User1 is assigned only the Reader role for VM1. User1 has no roles assigned for Workspace1 or its resource group. User1 needs to run a query to analyze the average CPU utilization of VM1 over the last 24 hours, aggregated in 1-hour intervals. Which action should the administrator instruct User1 to perform?
- Open the Logs blade of VM1 in the Azure portal, and run the query: Perf | where TimeGenerated > ago(24h) and CounterName == '% Processor Time' | summarize AvgCPU = avg(CounterValue) by bin(TimeGenerated, 1h)Answer
- BOpen the Logs blade of Workspace1 in the Azure portal, and run the query: Perf | where Computer == 'VM1' and TimeGenerated > ago(24h) and CounterName == '% Processor Time' | summarize AvgCPU = avg(CounterValue) by bin(TimeGenerated, 1h)
- COpen the Logs blade of VM1 in the Azure portal, and run the query: workspace('Workspace1').Perf | where TimeGenerated > ago(24h) and CounterName == '% Processor Time' | summarize AvgCPU = avg(CounterValue) by bin(TimeGenerated, 1h)
- DOpen the Logs blade of VM1 in the Azure portal, and run the query: AzureActivity | where TimeGenerated > ago(24h) and OperationNameValue == 'Microsoft.Compute/virtualMachines/read' | summarize Count = count() by bin(TimeGenerated, 1h)
Answer
Open the Logs blade of VM1 in the Azure portal and query the Perf table using the correct KQL aggregation syntax.
The correct option instructs User1 to query from the VM1 Logs blade, which leverages resource-context access. Since User1 has Reader rights on VM1 and the workspace allows resource-context queries, User1 can query VM1 logs. The KQL query correctly retrieves performance metrics, filters for CPU percentage, and aggregates data in 1-hour intervals.
Step-by-Step Solution
Key Concept
Resource-context vs. Workspace-context access modes and KQL Performance table schema