azureblog.co.uk
← 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 ID66bb4e9e-b016-4a94-8249-4c0511c2be84
CategoryManagement-and-governance
Actions4
Data actions2

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

PermissionWhat it allows
Microsoft.Authorization/policyassignments/readGet information about a policy assignment.
Microsoft.Authorization/policydefinitions/readGet information about a policy definition.
Microsoft.Authorization/policyexemptions/readGet information about a policy exemption.
Microsoft.Authorization/policysetdefinitions/readGet information about a policy set definition.

Data actions

PermissionWhat it allows
Microsoft.PolicyInsights/checkDataPolicyCompliance/actionCheck the compliance status of a given component against data policies.
Microsoft.PolicyInsights/policyEvents/logDataEvents/actionLog the resource component policy events.

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 "Policy Insights Data Writer (Preview)" \
  --scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"
powershell3 lines
New-AzRoleAssignment -SignInName "jane.doe@contoso.com" `
  -RoleDefinitionName "Policy Insights Data Writer (Preview)" `
  -Scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"
bicep7 lines
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?

kql · azure resource graph
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

Find the smallest role for a task →