Bagikan melalui


PolicyAssignment Class

Definition

The policy assignment.

[System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.PolicyAssignmentTypeConverter))]
public class PolicyAssignment : Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.IPolicyAssignment
[<System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.PolicyAssignmentTypeConverter))>]
type PolicyAssignment = class
    interface IPolicyAssignment
    interface IJsonSerializable
Public Class PolicyAssignment
Implements IPolicyAssignment
Inheritance
PolicyAssignment
Attributes
Implements

Constructors

PolicyAssignment()

Creates an new PolicyAssignment instance.

Properties

DefinitionVersion

The version of the policy definition to use.

Description

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

DisplayName

The display name of the policy assignment.

EnforcementMode

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

Id

The ID of the policy assignment.

IdentityPrincipalId

The principal ID of the resource identity. This property will only be provided for a system assigned identity

IdentityTenantId

The tenant ID of the resource identity. This property will only be provided for a system assigned identity

IdentityType

The identity type. This is the only required field when adding a system or user assigned identity to a resource.

IdentityUserAssignedIdentity

The user identity associated with the policy. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.

Location

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

Metadata

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

Name

The name of the policy assignment.

NonComplianceMessage

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

NotScope

The policy's excluded scopes.

Override

The policy property value override.

Parameter

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

PolicyDefinitionId

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

ResourceSelector

The resource selector list to filter policies by resource properties.

Scope

The scope for the policy assignment.

SystemDataCreatedAt

The timestamp of resource creation (UTC).

SystemDataCreatedBy

The identity that created the resource.

SystemDataCreatedByType

The type of identity that created the resource.

SystemDataLastModifiedAt

The timestamp of resource last modification (UTC)

SystemDataLastModifiedBy

The identity that last modified the resource.

SystemDataLastModifiedByType

The type of identity that last modified the resource.

Type

The type of the policy assignment.

Methods

DeserializeFromDictionary(IDictionary)

Deserializes a IDictionary into an instance of PolicyAssignment.

DeserializeFromPSObject(PSObject)

Deserializes a PSObject into an instance of PolicyAssignment.

FromJson(JsonNode)

Deserializes a JsonNode into an instance of Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.IPolicyAssignment.

FromJsonString(String)

Creates a new instance of PolicyAssignment, deserializing the content from a json string.

ToJson(JsonObject, SerializationMode)

Serializes this instance of PolicyAssignment into a JsonNode.

ToJsonString()

Serializes this instance to a json string.

Applies to