← cd ~/roles
// roles/azure · management-and-governance
Policy Insights Data Writer (Preview)Azure built-in role
Allows read access to resource policies and write access to resource component policy events.
| Role ID | 66bb4e9e-b016-4a94-8249-4c0511c2be84 |
|---|---|
| Category | Management-and-governance |
| Actions | 4 |
| Data actions | 2 |
Before you assign it
- It reaches the data, not just the resource. It has 2 data actions, such as reading blobs, secrets or messages.
What it can do
| Permission | What it allows |
|---|---|
Microsoft.Authorization/policyassignments/read | Get information about a policy assignment. |
Microsoft.Authorization/policydefinitions/read | Get information about a policy definition. |
Microsoft.Authorization/policyexemptions/read | Get information about a policy exemption. |
Microsoft.Authorization/policysetdefinitions/read | Get information about a policy set definition. |
Data actions
| Permission | What it allows |
|---|---|
Microsoft.PolicyInsights/checkDataPolicyCompliance/action | Check the compliance status of a given component against data policies. |
Microsoft.PolicyInsights/policyEvents/logDataEvents/action | Log the resource component policy events. |
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 "Policy Insights Data Writer (Preview)" \
--scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"New-AzRoleAssignment -SignInName "jane.doe@contoso.com" `
-RoleDefinitionName "Policy Insights Data Writer (Preview)" `
-Scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"resource assignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
name: guid(resourceGroup().id, principalId, '66bb4e9e-b016-4a94-8249-4c0511c2be84')
properties: {
roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '66bb4e9e-b016-4a94-8249-4c0511c2be84')
principalId: principalId
}
}Who already has it?
authorizationresources
| where type == "microsoft.authorization/roleassignments"
| where tostring(properties.roleDefinitionId) endswith "66bb4e9e-b016-4a94-8249-4c0511c2be84"
| project principalId = tostring(properties.principalId), principalType = tostring(properties.principalType), scope = tostring(properties.scope)Other management-and-governance roles
- Service Group Contributor · 1 permission
- Template Spec Reader · 1 permission
- Carbon Optimization Reader · 2 permissions
- Hierarchy Settings Administrator · 2 permissions
- Reservations Reader · 2 permissions
- Service Group Reader · 2 permissions
- Advisor Reviews Reader · 3 permissions
- Managed Application Operator Role · 3 permissions