← cd ~/roles
// roles/azure · monitor
Data PurgerAzure built-in role
Can purge analytics data
| Role ID | 150f5e0c-0603-4f03-8c7f-cf70034c4e90 |
|---|---|
| Category | Monitor |
| Actions | 4 |
| Data actions | 0 |
What it can do
| Permission | What it allows |
|---|---|
Microsoft.Insights/components/*/read | Any read operation on anything under Microsoft.Insights/components |
Microsoft.Insights/components/purge/action | Purging data from Application Insights |
Microsoft.OperationalInsights/workspaces/*/read | Any read operation on anything under Microsoft.OperationalInsights/workspaces |
Microsoft.OperationalInsights/workspaces/purge/action | Delete specified data by query from workspace. |
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 "Data Purger" \
--scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"New-AzRoleAssignment -SignInName "jane.doe@contoso.com" `
-RoleDefinitionName "Data Purger" `
-Scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"resource assignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
name: guid(resourceGroup().id, principalId, '150f5e0c-0603-4f03-8c7f-cf70034c4e90')
properties: {
roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '150f5e0c-0603-4f03-8c7f-cf70034c4e90')
principalId: principalId
}
}Who already has it?
authorizationresources
| where type == "microsoft.authorization/roleassignments"
| where tostring(properties.roleDefinitionId) endswith "150f5e0c-0603-4f03-8c7f-cf70034c4e90"
| 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
- Log Analytics Reader · 5 permissions