Table of Contents

Class PolicyDefinitionData

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

A class representing the PolicyDefinition data model. The policy definition.

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

Constructors

PolicyDefinitionData()

Initializes a new instance of PolicyDefinitionData.

public PolicyDefinitionData()

Properties

Description

The policy definition description.

public string Description { get; set; }

Property Value

string

DisplayName

The display name of the policy definition.

public string DisplayName { get; set; }

Property Value

string

Metadata

The policy definition 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

Mode

The policy definition mode. Some examples are All, Indexed, Microsoft.KeyVault.Data.

public string Mode { get; set; }

Property Value

string

Parameters

The parameter definitions for parameters used in the policy rule. The keys are the parameter names.

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

Property Value

IDictionary<string, ArmPolicyParameter>

PolicyRule

The policy rule.

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 PolicyRule { get; set; }

Property Value

BinaryData

PolicyType

The type of policy definition. Possible values are NotSpecified, BuiltIn, Custom, and Static.

public PolicyType? PolicyType { get; set; }

Property Value

PolicyType?