Resource policy assignments - az policy assignment

Manage resource policy assignments.

Commands

az policy assignment create Create a resource policy assignment.
az policy assignment delete Delete a resource policy assignment.
az policy assignment list List resource policy assignments.
az policy assignment show Show a resource policy assignment.

az policy assignment create

Create a resource policy assignment.

az policy assignment create --policy
[--display-name]
[--name]
[--resource-group]
[--scope]

Required Parameters

--policy

Policy name or fully qualified id.

Optional Parameters

--display-name

Display name of the assignment.

--name -n

Name of the new assignment.

--resource-group -g

The resource group where the policy will be applied.

--scope

Scope at which this policy assignment applies to, e.g., /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333, /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333/resourceGroups/myGroup, or /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333/resourceGroups/myGroup/providers/Microsoft.Compute/virtualMachines/myVM.

az policy assignment delete

Delete a resource policy assignment.

az policy assignment delete --name
[--resource-group]
[--scope]

Required Parameters

--name -n

Name of the assignment.

Optional Parameters

--resource-group -g

The resource group where the policy will be applied.

--scope

Scope at which this policy assignment applies to, e.g., /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333, /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333/resourceGroups/myGroup, or /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333/resourceGroups/myGroup/providers/Microsoft.Compute/virtualMachines/myVM.

az policy assignment list

List resource policy assignments.

az policy assignment list [--disable-scope-strict-match]
[--resource-group]
[--scope]

Optional Parameters

--disable-scope-strict-match

Include assignment either inhertied from parent scope or at child scope.

--resource-group -g

The resource group where the policy will be applied.

--scope

Scope at which this policy assignment applies to, e.g., /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333, /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333/resourceGroups/myGroup, or /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333/resourceGroups/myGroup/providers/Microsoft.Compute/virtualMachines/myVM.

az policy assignment show

Show a resource policy assignment.

az policy assignment show --name
[--resource-group]
[--scope]

Required Parameters

--name -n

Name of the assignment.

Optional Parameters

--resource-group -g

The resource group where the policy will be applied.

--scope

Scope at which this policy assignment applies to, e.g., /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333, /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333/resourceGroups/myGroup, or /subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333/resourceGroups/myGroup/providers/Microsoft.Compute/virtualMachines/myVM.