azureblog.co.uk
← cd ~/roles
// roles/azure · monitor

Log Analytics ContributorAzure built-in role

Log Analytics Contributor can read all monitoring data and edit monitoring settings. Editing monitoring settings includes adding the VM extension to VMs; reading storage account keys to be able to configure collection of logs from Azure Storage; adding solutions; and configuring Azure diagnostics on all Azure resources.

Role ID92aaf0da-9dab-42b6-94a3-d43ce8d16293
CategoryMonitor
Actions13
Data actions1

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

PermissionWhat it allows
*/readEvery operation matching */read
Microsoft.ClassicCompute/virtualMachines/extensions/*Every operation under Microsoft.ClassicCompute/virtualMachines/extensions
Microsoft.ClassicStorage/storageAccounts/listKeys/action
Microsoft.Compute/virtualMachines/extensions/*Every operation under Microsoft.Compute/virtualMachines/extensions
Microsoft.HybridCompute/machines/extensions/writeInstalls or Updates an Azure Arc extensions
Microsoft.Insights/alertRules/*Every operation under Microsoft.Insights/alertRules
Microsoft.Insights/diagnosticSettings/*Every operation under Microsoft.Insights/diagnosticSettings
Microsoft.OperationalInsights/*Every operation under Microsoft.OperationalInsights
Microsoft.OperationsManagement/*Every operation under Microsoft.OperationsManagement
Microsoft.Resources/deployments/*Every operation under Microsoft.Resources/deployments
Microsoft.Resources/subscriptions/resourcegroups/deployments/*Every operation under Microsoft.Resources/subscriptions/resourcegroups/deployments
Microsoft.Storage/storageAccounts/listKeys/actionReturns the access keys for the specified storage account.
Microsoft.Support/*Every operation under Microsoft.Support

Data actions

PermissionWhat it allows
Microsoft.OperationalInsights/workspaces/jobs/export/actionLets 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.

azure cli
az role assignment create \
  --assignee "jane.doe@contoso.com" \
  --role "Log Analytics Contributor" \
  --scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"
powershell3 lines
New-AzRoleAssignment -SignInName "jane.doe@contoso.com" `
  -RoleDefinitionName "Log Analytics Contributor" `
  -Scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"
bicep7 lines
resource assignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
  name: guid(resourceGroup().id, principalId, '92aaf0da-9dab-42b6-94a3-d43ce8d16293')
  properties: {
    roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '92aaf0da-9dab-42b6-94a3-d43ce8d16293')
    principalId: principalId
  }
}

Who already has it?

kql · azure resource graph
authorizationresources
| where type == "microsoft.authorization/roleassignments"
| where tostring(properties.roleDefinitionId) endswith "92aaf0da-9dab-42b6-94a3-d43ce8d16293"
| project principalId = tostring(properties.principalId), principalType = tostring(properties.principalType), scope = tostring(properties.scope)

Other monitor roles

Find the smallest role for a task →