Microsoft.Resources tags 2024-03-01

Bicep resource definition

The tags 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. See Set scope on extension resources in Bicep.

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

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

Remarks

To learn about applying tags through ARM templates or Bicep files, see Use tags to organize your Azure resources and management hierarchy.

Resource format

To create a Microsoft.Resources/tags resource, add the following Bicep to your template.

resource symbolicname 'Microsoft.Resources/tags@2024-03-01' = {
  name: 'default'
  scope: resourceSymbolicName
  properties: {
    tags: {
      tagName1: 'tagValue1'
      tagName2: 'tagValue2'
    }
  }
}

Property values

tags

Name Description Value
name The resource name 'default'
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.
properties The set of tags. Tags (required)

Tags

Name Description Value
tags Dictionary of {string} object

ARM template resource definition

The tags 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. See Set scope on extension resources in ARM templates.

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

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

Remarks

To learn about applying tags through ARM templates or Bicep files, see Use tags to organize your Azure resources and management hierarchy.

Resource format

To create a Microsoft.Resources/tags resource, add the following JSON to your template.

{
  "type": "Microsoft.Resources/tags",
  "apiVersion": "2024-03-01",
  "name": "default",
  "scope": "string",
  "properties": {
    "tags": {
      "tagName1": "tagValue1",
      "tagName2": "tagValue2"
    }
  }
}

Property values

tags

Name Description Value
type The resource type 'Microsoft.Resources/tags'
apiVersion The resource api version '2024-03-01'
name The resource name 'default'
scope Use when creating an extension resource at a scope that is different than the deployment scope. Target resource

For JSON, set the value to the full name of the resource to apply the extension resource to.
properties The set of tags. Tags (required)

Tags

Name Description Value
tags Dictionary of {string} object

Terraform (AzAPI provider) resource definition

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

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

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

  • Resource groups
  • Subscriptions
  • Management groups

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

Resource format

To create a Microsoft.Resources/tags resource, add the following Terraform to your template.

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.Resources/tags@2024-03-01"
  name = "default"
  parent_id = "string"
  body = jsonencode({
    properties = {
      tags = {
        tagName1 = "tagValue1"
        tagName2 = "tagValue2"
      }
    }
  })
}

Property values

tags

Name Description Value
type The resource type "Microsoft.Resources/tags@2024-03-01"
name The resource name "default"
parent_id The ID of the resource to apply this extension resource to. string (required)
properties The set of tags. Tags (required)

Tags

Name Description Value
tags Dictionary of {string} object