Microsoft.Authorization policyAssignments 2015-11-01

Bicep resource definition

The policyAssignments resource type can be deployed with operations that target:

For a list of changed properties in each API version, see change log.

Resource format

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

resource symbolicname 'Microsoft.Authorization/policyAssignments@2015-11-01' = {
  scope: resourceSymbolicName or scope
  name: 'string'
  properties: {
    displayName: 'string'
    policyDefinitionId: 'string'
    scope: 'string'
  }
}

Property values

Microsoft.Authorization/policyAssignments

Name Description Value
name The resource name string (required)
properties Gets or sets the policy assignment properties. PolicyAssignmentProperties
scope Use when creating a resource at a scope that is different than the deployment scope. Set this property to the symbolic name of a resource to apply the extension resource.

PolicyAssignmentProperties

Name Description Value
displayName Gets or sets the policy assignment display name. string
policyDefinitionId Gets or sets the policy definition Id. string
scope Gets or sets the policy assignment scope. string

Quickstart samples

The following quickstart samples deploy this resource type.

Bicep File Description
Assign built-in policy to audit VM managed disks This template assigns a built-in policy to a resource group scope to audit virtual machine (VM) managed disks.
Create an Azure Virtual Network Manager and sample VNETs This template deploys an Azure Virtual Network Manager and sample virtual networks into the named resource group. It supports multiple connectivity topologies and network group membership types.
Deploy a Policy Def and Assign to Multiple Mgmt Groups This template is a management group level template that will create a policy definition and assign that policy to multiple management groups.
Deploy a policy definition and assign to a management group 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.

ARM template resource definition

The policyAssignments resource type can be deployed with operations that target:

For a list of changed properties in each API version, see change log.

Resource format

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

{
  "type": "Microsoft.Authorization/policyAssignments",
  "apiVersion": "2015-11-01",
  "name": "string",
  "properties": {
    "displayName": "string",
    "policyDefinitionId": "string",
    "scope": "string"
  }
}

Property values

Microsoft.Authorization/policyAssignments

Name Description Value
apiVersion The api version '2015-11-01'
name The resource name string (required)
properties Gets or sets the policy assignment properties. PolicyAssignmentProperties
type The resource type 'Microsoft.Authorization/policyAssignments'

PolicyAssignmentProperties

Name Description Value
displayName Gets or sets the policy assignment display name. string
policyDefinitionId Gets or sets the policy definition Id. string
scope Gets or sets the policy assignment scope. string

Quickstart templates

The following quickstart templates deploy this resource type.

Template Description
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.
Assign built-in policy to audit VM managed disks

Deploy to Azure
This template assigns a built-in policy to a resource group scope to audit virtual machine (VM) managed disks.
Create an Azure Virtual Network Manager and sample VNETs

Deploy to Azure
This template deploys an Azure Virtual Network Manager and sample virtual networks into the named resource group. It supports multiple connectivity topologies and network group membership types.
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.
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.

Terraform (AzAPI provider) resource definition

The policyAssignments resource type can be deployed with operations that target:

For a list of changed properties in each API version, see change log.

Resource format

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

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.Authorization/policyAssignments@2015-11-01"
  name = "string"
  parent_id = "string"
  body = jsonencode({
    properties = {
      displayName = "string"
      policyDefinitionId = "string"
      scope = "string"
    }
  })
}

Property values

Microsoft.Authorization/policyAssignments

Name Description Value
name The resource name string (required)
parent_id The ID of the resource to apply this extension resource to. string (required)
properties Gets or sets the policy assignment properties. PolicyAssignmentProperties
type The resource type "Microsoft.Authorization/policyAssignments@2015-11-01"

PolicyAssignmentProperties

Name Description Value
displayName Gets or sets the policy assignment display name. string
policyDefinitionId Gets or sets the policy definition Id. string
scope Gets or sets the policy assignment scope. string