Microsoft.Authorization policyAssignments 2017-06-01-preview

The policyAssignments 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.

Valid deployment scopes for the policyAssignments resource are:

  • Management Group
  • Subscription
  • Resource Group

Template format

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

resource symbolicname 'Microsoft.Authorization/policyAssignments@2017-06-01-preview' = {
  name: 'string'
  sku: {
    name: 'string'
    tier: 'string'
  }
  scope: resourceSymbolicName
  properties: {
    description: 'string'
    displayName: 'string'
    metadata: any()
    notScopes: [
      'string'
    ]
    parameters: any()
    policyDefinitionId: 'string'
    scope: 'string'
  }
}

Property values

policyAssignments

Name Description Value
type The resource type

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

For Bicep, set this value in the resource declaration.
'2017-06-01-preview'
name The resource name string (required)

Character limit: 1-128 display name

1-64 resource name

1-24 resource name at management group scope

Valid characters:
Display name can contain any characters.

Resource name can't use:
<>*%&:\?.+/ or control characters.

Can't end with period or space.
sku The policy sku. PolicySku
scope Use when creating an extension resource at a scope that is different than the deployment scope. Target resource

For Bicep, set this property to the symbolic name of the resource to apply the extension resource.

For JSON, set the value to the full name of the resource to apply the extension resource to.
properties The policy assignment properties. PolicyAssignmentProperties

PolicyAssignmentProperties

Name Description Value
description This message will be part of response in case of policy violation. string
displayName The display name of the policy assignment. string
metadata Any object For Bicep, you can use the any() function.
notScopes The policy's excluded scopes. string[]
parameters Any object For Bicep, you can use the any() function.
policyDefinitionId The ID of the policy definition. string
scope The scope for the policy assignment. string

PolicySku

Name Description Value
name The name of the policy sku. Possible values are A0 and A1. string (required)
tier The policy sku tier. Possible values are Free and Standard. string

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.
Assign a built-in policy to an existing resource group

Deploy to Azure
This template assigns a built-in policy to an existing resource group.