Microsoft.Authorization policyDefinitions 2021-06-01

The policyDefinitions resource type is an extension resource, which means you can apply it to another resource.

Use the scope property on this resource to set the scope for this resource.

Template format

To create a Microsoft.Authorization/policyDefinitions resource, add the following Bicep or JSON to your template.

resource symbolicname 'Microsoft.Authorization/policyDefinitions@2021-06-01' = {
  name: 'string'
  scope: scopeObject
  properties: {
    description: 'string'
    displayName: 'string'
    metadata: any()
    mode: 'string'
    parameters: {}
    policyRule: any()
    policyType: 'string'
  }
}

Property values

policyDefinitions

Name Description Value
type The resource type

For Bicep, set this value in the resource declaration.
'Microsoft.Authorization/policyDefinitions'
apiVersion The resource api version

For Bicep, set this value in the resource declaration.
'2021-06-01'
name The resource name string (required)
scope Use when creating an extension resource at a scope that is different than the deployment scope.

For Bicep, set this property to the symbolic name of the resource to apply the extension resource to. See Set scope for extension resources in Bicep.

For JSON, set the value to the full name of the resource to apply the extension resource to. See Setting scope on extension resources in ARM templates.
scopeObject
properties The policy definition properties. PolicyDefinitionProperties

PolicyDefinitionProperties

Name Description Value
description The policy definition description. string
displayName The display name of the policy definition. string
metadata Any object For Bicep, you can use the any() function.
mode The policy definition mode. Some examples are All, Indexed, Microsoft.KeyVault.Data. string
parameters The parameter definitions for parameters used in the policy. The keys are the parameter names. object
policyRule Any object For Bicep, you can use the any() function.
policyType The type of policy definition. Possible values are NotSpecified, BuiltIn, Custom, and Static. 'BuiltIn'
'Custom'
'NotSpecified'
'Static'

Quickstart templates

The following quickstart templates deploy this resource type.

Template Description
Deploy a policy definition and assign to a management group

Deploy to Azure
This template is a management group level template that will create a policy definition and assign that policy to the target management group. Currently, this template cannot be deployed via the Azure Portal.
Deploy a Policy Def and Assign to Multiple Mgmt Groups

Deploy to Azure
This template is a management group level template that will create a policy definition and assign that policy to multiple management groups.