Skip to content

Commit ebeb762

Browse files
committed
added Powershell for policies2
1 parent 69d8f7c commit ebeb762

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

articles/azure-monitor/essentials/diagnostics-settings-policies-deployifnotexists.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@ Select your subscription and set your resource group
117117
```azurepowershell
118118
$policyAssignment=New-AzPolicyAssignment -Name <assignment name> -DisplayName "assignment display name" -Scope $rg.ResourceId -PolicyDefinition $definition -PolicyparameterObject $params -IdentityType 'SystemAssigned' -Location <location>
119119
120+
#To get your assignemnt use:
121+
$policyAssignment=Get-AzPolicyAssignment -Name '<assignment name>' -Scope '/subscriptions/<subscriptionID>/resourcegroups/<resource group name>'
122+
120123
```
121124

122125
1. Assign the required role or roles to the system assigned Managed Identity
@@ -142,7 +145,6 @@ Get-AzPolicyState -PolicyAssignmentName $policyAssignment.Name -ResourceGroupNa
142145
```
143146

144147

145-
$policyAssignment=Get-AzPolicyAssignment -Name 'VaultsLAWorkspace-04' -Scope '/subscriptions/d0567c0b-5849-4a5d-a2eb-5267eae1bbc7/resourcegroups/ed-ps-policy'
146148

147149
---
148150
## Assign initiatives

0 commit comments

Comments
 (0)