← cd ~/roles
// roles/azure · monitor
Log Analytics Data ReaderAzure built-in role
Log Analytics Data Reader can query and search the logs it is allowed to view over Log Analytics workspaces and tables
| Role ID | 3b03c2da-16b3-4a49-8834-0f8130efdd3b |
|---|---|
| Category | Monitor |
| Actions | 2 |
| Data actions | 1 |
Before you assign it
- It reaches the data, not just the resource. It has 1 data action, such as reading blobs, secrets or messages.
What it can do
| Permission | What it allows |
|---|---|
Microsoft.OperationalInsights/workspaces/query/read | Run queries over the data in the workspace |
Microsoft.OperationalInsights/workspaces/read | Gets an existing workspace |
Data actions
| Permission | What it allows |
|---|---|
Microsoft.OperationalInsights/workspaces/tables/data/read | Allows you to provide read data access to workspaces, or more fine-grained data entities, such as specific tables or rows. |
Assign it
Scope it as tightly as you can: a resource or resource group rather than the whole subscription.
az role assignment create \
--assignee "jane.doe@contoso.com" \
--role "Log Analytics Data Reader" \
--scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"New-AzRoleAssignment -SignInName "jane.doe@contoso.com" `
-RoleDefinitionName "Log Analytics Data Reader" `
-Scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"resource assignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
name: guid(resourceGroup().id, principalId, '3b03c2da-16b3-4a49-8834-0f8130efdd3b')
properties: {
roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '3b03c2da-16b3-4a49-8834-0f8130efdd3b')
principalId: principalId
}
}Who already has it?
authorizationresources
| where type == "microsoft.authorization/roleassignments"
| where tostring(properties.roleDefinitionId) endswith "3b03c2da-16b3-4a49-8834-0f8130efdd3b"
| project principalId = tostring(properties.principalId), principalType = tostring(properties.principalType), scope = tostring(properties.scope)Other monitor roles
- Grafana Admin · 1 permission
- Grafana Editor · 1 permission
- Grafana Limited Viewer · 1 permission
- Grafana Viewer · 1 permission
- Monitoring Reader · 3 permissions
- Workbook Reader · 3 permissions
- Data Purger · 4 permissions
- Log Analytics Reader · 5 permissions