Complete the code to enable basic monitoring on an Azure VM.
az vm extension set --resource-group myResourceGroup --vm-name myVM --name [1] --publisher Microsoft.Azure.Monitor --version 1.0
The AzureMonitorWindowsAgent extension enables monitoring on Azure VMs.
Complete the command to create an Azure Monitor alert rule for CPU usage.
az monitor metrics alert create --name HighCPUAlert --resource-group myResourceGroup --scopes [1] --condition "avg Percentage CPU > 80" --description "Alert on high CPU usage"
The scope must be the resource ID of the VM to monitor CPU usage.
Fix the error in the Azure CLI command to enable diagnostic settings for a storage account.
az monitor diagnostic-settings create --resource [1] --name diagSettings --workspace myWorkspace --logs '[{"category": "StorageRead", "enabled": true}]'
The --resource parameter requires the full resource ID, not just the name.
Fill both blanks to create a log query that counts errors in Azure Monitor logs.
AzureDiagnostics | where [1] == 'Error' | summarize count() by [2]
The Level field filters error logs, and Resource groups the count by resource.
Fill all three blanks to create an alert rule that triggers when average response time exceeds 1000 ms.
az monitor metrics alert create --name ResponseTimeAlert --resource-group myResourceGroup --scopes [1] --condition "avg [2] > [3]" --description "Alert on high response time"
The scope is the web app resource ID, the metric is ResponseTime, and the threshold is 1000 ms.