PolicyAssignment Class

The policy assignment.

Variables are only populated by the server, and will be ignored when sending a request.

Constructor

PolicyAssignment(*, location: str | None = None, identity: _models.Identity | None = None, display_name: str | None = None, policy_definition_id: str | None = None, definition_version: str | None = None, not_scopes: List[str] | None = None, parameters: Dict[str, _models.ParameterValuesValue] | None = None, description: str | None = None, metadata: MutableMapping[str, Any] | None = None, enforcement_mode: str | _models.EnforcementMode = 'Default', non_compliance_messages: List[_models.NonComplianceMessage] | None = None, resource_selectors: List[_models.ResourceSelector] | None = None, overrides: List[_models.Override] | None = None, **kwargs: Any)

Keyword-Only Parameters

Name Description
location
str

The location of the policy assignment. Only required when utilizing managed identity.

Default value: None
identity

The managed identity associated with the policy assignment.

Default value: None
display_name
str

The display name of the policy assignment.

Default value: None
policy_definition_id
str

The ID of the policy definition or policy set definition being assigned.

Default value: None
definition_version
str

The version of the policy definition to use.

Default value: None
not_scopes

The policy's excluded scopes.

Default value: None
parameters

The parameter values for the assigned policy rule. The keys are the parameter names.

Default value: None
description
str

This message will be part of response in case of policy violation.

Default value: None
metadata

The policy assignment metadata. Metadata is an open ended object and is typically a collection of key value pairs.

Default value: None
enforcement_mode

The policy assignment enforcement mode. Possible values are Default and DoNotEnforce. Known values are: "Default" and "DoNotEnforce".

Default value: Default
non_compliance_messages

The messages that describe why a resource is non-compliant with the policy.

Default value: None
resource_selectors

The resource selector list to filter policies by resource properties.

Default value: None
overrides

The policy property value override.

Default value: None

Variables

Name Description
id
str

The ID of the policy assignment.

type
str

The type of the policy assignment.

name
str

The name of the policy assignment.

location
str

The location of the policy assignment. Only required when utilizing managed identity.

identity

The managed identity associated with the policy assignment.

system_data

The system metadata relating to this resource.

display_name
str

The display name of the policy assignment.

policy_definition_id
str

The ID of the policy definition or policy set definition being assigned.

definition_version
str

The version of the policy definition to use.

latest_definition_version
str

The latest version of the policy definition available. This is only present if requested via the $expand query parameter.

effective_definition_version
str

The effective version of the policy definition in use. This is only present if requested via the $expand query parameter.

scope
str

The scope for the policy assignment.

not_scopes

The policy's excluded scopes.

parameters

The parameter values for the assigned policy rule. The keys are the parameter names.

description
str

This message will be part of response in case of policy violation.

metadata
<xref:JSON>

The policy assignment metadata. Metadata is an open ended object and is typically a collection of key value pairs.

enforcement_mode

The policy assignment enforcement mode. Possible values are Default and DoNotEnforce. Known values are: "Default" and "DoNotEnforce".

non_compliance_messages

The messages that describe why a resource is non-compliant with the policy.

resource_selectors

The resource selector list to filter policies by resource properties.

overrides

The policy property value override.