You have an Azure subscription containing a Log Analytics workspace named Workspace1. Multiple Azure virtual machines in different resource groups send their performance metrics and diagnostic logs to Workspace1. You need to allow a user named User1 to run Kusto Query Language (KQL) queries to analyze the CPU usage of only the virtual machines located in a resource group named RG-Prod. User1 must not be able to view logs for virtual machines in other resource groups. Which configuration should you implement?
- Assign User1 the Reader role on RG-Prod, and configure the access control mode of Workspace1 to use resource or workspace permissions.Answer
- BAssign User1 the Log Analytics Reader role on Workspace1, and configure the access control mode of Workspace1 to require workspace permissions.
- CAssign User1 the Reader role on RG-Prod, and configure the access control mode of Workspace1 to require workspace permissions.
- DAssign User1 the Monitoring Reader role on Workspace1, and configure the access control mode of Workspace1 to use resource or workspace permissions.
Answer
Assign User1 the Reader role on RG-Prod, and configure the access control mode of Workspace1 to use resource or workspace permissions.
The correct configuration is to assign User1 the Reader role on the resource group RG-Prod and configure the workspace to use resource or workspace permissions. This ensures resource-context access is enabled. With this setting, users can query log data for resources they have read access to, without needing access to the workspace itself. This restricts the user from seeing logs for virtual machines in other resource groups.
Step-by-Step Solution
Key Concept
Log Analytics Access Control Modes (Resource-context vs Workspace-context)