Language

PolicyDefinition Class

Definition

The policy definition.

[System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.PolicyDefinitionTypeConverter))]
public class PolicyDefinition : Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.IPolicyDefinition
[System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.PolicyDefinitionTypeConverter))]
public class PolicyDefinition : Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.IPolicyDefinition, Microsoft.Azure.PowerShell.Cmdlets.Policy.Runtime.IValidates
[<System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.PolicyDefinitionTypeConverter))>]
type PolicyDefinition = class
    interface IPolicyDefinition
    interface IJsonSerializable
[<System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Policy.Models.PolicyDefinitionTypeConverter))>]
type PolicyDefinition = class
    interface IPolicyDefinition
    interface IJsonSerializable
    interface IProxyResource
    interface IResource
    interface IValidates
Public Class PolicyDefinition
Implements IPolicyDefinition
Public Class PolicyDefinition
Implements IPolicyDefinition, IValidates
Inheritance
PolicyDefinition
Attributes
Implements

Constructors

Name Description
PolicyDefinition()

Creates an new PolicyDefinition instance.

Properties

Name Description
Description

The policy definition description.

DisplayName

The display name of the policy definition.

EndpointSettingDetail

The external evaluation endpoint settings detail, exposed with its pre-migration named type IExternalEvaluationEndpointSettingsDetails instead of the raw IAny.

EndpointSettingDetailRaw

The details of the endpoint.

EndpointSettingKind

The kind of the endpoint.

ExternalEvaluationEnforcementSettingMissingTokenAction

What to do when evaluating an enforcement policy that requires an external evaluation and the token is missing. Possible values are Audit and Deny and language expressions are supported.

ExternalEvaluationEnforcementSettingResultLifespan

The lifespan of the endpoint invocation result after which it's no longer valid. Value is expected to follow the ISO 8601 duration format and language expressions are supported.

ExternalEvaluationEnforcementSettingRoleDefinitionId

An array of the role definition Ids the assignment's MSI will need in order to invoke the endpoint.

Id

Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

Metadata

The policy definition metadata, exposed with its pre-migration named type IPolicyDefinitionPropertiesMetadata instead of the raw IAny. The generated flattened property is renamed to MetadataRaw (see tspconfig.yaml) so this back-compatible accessor owns the Metadata name. It reads/writes the same underlying Property.Metadata storage, so behavior is unchanged.

MetadataRaw

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

Mode

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

Name

The name of the resource

Parameter

The policy definition parameter definitions, exposed with its pre-migration named type IParameterDefinitions (the emitter renamed it to IPolicyDefinitionPropertiesParameters). The generated flattened property is renamed to ParameterRaw (see tspconfig.yaml) so this back-compatible accessor owns the Parameter name, reading/writing the same Property.Parameter storage.

ParameterRaw

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

PolicyRule

The policy rule, exposed with its pre-migration named type IPolicyDefinitionPropertiesPolicyRule instead of the raw IAny.

PolicyRuleRaw

The policy rule.

PolicyType

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

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 resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

Version

The policy definition version in #.#.# format.

Versions

A list of available versions for this policy definition.

Methods

Name Description
DeserializeFromDictionary(IDictionary)

Deserializes a IDictionary into an instance of PolicyDefinition.

DeserializeFromPSObject(PSObject)

Deserializes a PSObject into an instance of PolicyDefinition.

FromJson(JsonNode)

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

FromJsonString(String)

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

ToJson(JsonObject, SerializationMode)

Serializes this instance of PolicyDefinition into a JsonNode.

ToJsonString()

Serializes this instance to a json string.

Validate(IEventListener)

Validates that this object meets the validation criteria.

Applies to