@@ -354,6 +354,8 @@ Finally, publish the policy definitions using the `Publish-GuestConfigurationPol
354
354
cmdlet only has the ** Path** parameter that points to the location of the JSON files created by
355
355
` New-GuestConfigurationPolicy ` .
356
356
357
+ Publishing a new policy definition will require ** Resource Policy Contributor** access in Azure.
358
+
357
359
``` azurepowershell-interactive
358
360
Publish-GuestConfigurationPolicy `
359
361
-Path '.\policyDefinitions'
@@ -381,6 +383,23 @@ initiative with [Portal](../assign-policy-portal.md), [Azure CLI](../assign-poli
381
383
> assigned, the prerequisites aren't deployed and the policy always shows that '0' servers are
382
384
> compliant.
383
385
386
+ Assigning an Azure Policy with _ DeployIfNotExists_ type requires an additional level of access.
387
+ To grant the least privilege, you can create a custom role definition
388
+ that extends ** Resource Policy Contributor** . The example below creates a role named
389
+ ** Resource Policy Contributor DINE** with the additional permission * Microsoft.Authoirzation/roleAssignments/write* .
390
+
391
+ ``` azurepowershell-interactive
392
+ $subscriptionid = '00000000-0000-0000-0000-000000000000'
393
+ $role = Get-AzRoleDefinition "Resource Policy Contributor"
394
+ $role.Id = $null
395
+ $role.Name = "Resource Policy Contributor DINE"
396
+ $role.Description = "Can assign Policies that require remediation."
397
+ $role.Actions.Clear()
398
+ $role.Actions.Add("Microsoft.Authorization/roleAssignments/write")
399
+ $role.AssignableScopes.Clear()
400
+ $role.AssignableScopes.Add("/subscriptions/$subscriptionid")
401
+ New-AzRoleDefinition -Role $role
402
+ ```
384
403
385
404
### Using parameters in custom Guest Configuration policies
386
405
0 commit comments