← cd ~/roles
// roles/azure · monitor
Log Analytics ReaderAzure built-in role
Log Analytics Reader can view and search all monitoring data as well as and view monitoring settings, including viewing the configuration of Azure diagnostics on all Azure resources.
| Role ID | 73c42c96-874c-492b-b04d-ab87d138a893 |
|---|---|
| Category | Monitor |
| Actions | 4 (minus 1 NotActions) |
| 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 |
|---|---|
*/read | Every operation matching */read |
Microsoft.OperationalInsights/workspaces/analytics/query/action | Search using new engine. |
Microsoft.OperationalInsights/workspaces/search/action | Executes a search query |
Microsoft.Support/* | Every operation under Microsoft.Support |
Can't do
These are taken away from the actions above.
| Permission | What it allows |
|---|---|
Microsoft.OperationalInsights/workspaces/sharedKeys/read | Retrieves the shared keys for the workspace. These keys are used to connect Microsoft Operational Insights agents to the workspace. |
Data actions
| Permission | What it allows |
|---|---|
Microsoft.OperationalInsights/workspaces/jobs/export/action | Lets you export data from Log Analytics workspace per query and time range |
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 Reader" \
--scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"New-AzRoleAssignment -SignInName "jane.doe@contoso.com" `
-RoleDefinitionName "Log Analytics Reader" `
-Scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"resource assignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
name: guid(resourceGroup().id, principalId, '73c42c96-874c-492b-b04d-ab87d138a893')
properties: {
roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '73c42c96-874c-492b-b04d-ab87d138a893')
principalId: principalId
}
}Who already has it?
authorizationresources
| where type == "microsoft.authorization/roleassignments"
| where tostring(properties.roleDefinitionId) endswith "73c42c96-874c-492b-b04d-ab87d138a893"
| 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
- Log Analytics Data Reader · 3 permissions
- Monitoring Reader · 3 permissions
- Workbook Reader · 3 permissions
- Data Purger · 4 permissions