Table of Contents

Class PolicyAssignmentData

Namespace
Azure.ResourceManager.Resources
Assembly
Azure.ResourceManager.dll

A class representing the PolicyAssignment data model.

public class PolicyAssignmentData : ResourceData, IJsonModel<PolicyAssignmentData>, IPersistableModel<PolicyAssignmentData>
Inheritance
PolicyAssignmentData
Implements
IPersistableModel<PolicyAssignmentData>
Inherited Members

Constructors

PolicyAssignmentData()

Initializes a new instance of PolicyAssignmentData.

public PolicyAssignmentData()

Properties

Description

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

public string Description { get; set; }

Property Value

string

DisplayName

The display name of the policy assignment.

public string DisplayName { get; set; }

Property Value

string

EnforcementMode

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

public EnforcementMode? EnforcementMode { get; set; }

Property Value

EnforcementMode?

ExcludedScopes

The policy's excluded scopes.

public IList<string> ExcludedScopes { get; }

Property Value

IList<string>

Location

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

public AzureLocation? Location { get; set; }

Property Value

AzureLocation?

ManagedIdentity

The managed identity associated with the policy assignment. Current supported identity types: None, SystemAssigned, UserAssigned.

public ManagedServiceIdentity ManagedIdentity { get; set; }

Property Value

ManagedServiceIdentity

Metadata

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

To assign an object to this property use System.BinaryData.FromObjectAsJson``1(``0,System.Text.Json.JsonSerializerOptions).

To assign an already formatted json string to this property use System.BinaryData.FromString(System.String).

Examples:

  • BinaryData.FromObjectAsJson("foo")Creates a payload of "foo".
  • BinaryData.FromString("\"foo\"")Creates a payload of "foo".
  • BinaryData.FromObjectAsJson(new { key = "value" })Creates a payload of { "key": "value" }.
  • BinaryData.FromString("{\"key\": \"value\"}")Creates a payload of { "key": "value" }.
public BinaryData Metadata { get; set; }

Property Value

BinaryData

NonComplianceMessages

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

public IList<NonComplianceMessage> NonComplianceMessages { get; }

Property Value

IList<NonComplianceMessage>

Overrides

The policy property value override.

public IList<PolicyOverride> Overrides { get; }

Property Value

IList<PolicyOverride>

Parameters

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

public IDictionary<string, ArmPolicyParameterValue> Parameters { get; }

Property Value

IDictionary<string, ArmPolicyParameterValue>

PolicyDefinitionId

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

public string PolicyDefinitionId { get; set; }

Property Value

string

ResourceSelectors

The resource selector list to filter policies by resource properties.

public IList<ResourceSelector> ResourceSelectors { get; }

Property Value

IList<ResourceSelector>

Scope

The scope for the policy assignment.

public string Scope { get; }

Property Value

string