Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Bicep resource definition
The resourceGroups 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.Resources/resourceGroups resource, add the following Bicep to your template.
resource symbolicname 'Microsoft.Resources/resourceGroups@2020-06-01' = {
scope: resourceSymbolicName or scope
location: 'string'
managedBy: 'string'
name: 'string'
properties: {}
tags: {
{customized property}: 'string'
}
}
Property Values
Microsoft.Resources/resourceGroups
| Name | Description | Value |
|---|---|---|
| location | The location of the resource group. It cannot be changed after the resource group has been created. It must be one of the supported Azure locations. | string (required) |
| managedBy | The ID of the resource that manages this resource group. | string |
| name | The resource name | string Constraints: Min length = 1 Max length = 90 (required) |
| properties | The resource group properties. | ResourceGroupProperties |
| 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. |
| tags | Resource tags | Dictionary of tag names and values. See Tags in templates |
ResourceGroupProperties
| Name | Description | Value |
|---|
ResourceGroupTags
| Name | Description | Value |
|---|
Usage Examples
Bicep Samples
A basic example of deploying a resource group.
targetScope = 'subscription'
resource rg 'Microsoft.Resources/resourceGroups@2021-04-01' = {
name: 'myResourceGroup'
location: deployment().location
tags: {
environment: 'production'
}
}
Azure Verified Modules
The following Azure Verified Modules can be used to deploy this resource type.
| Module | Description |
|---|---|
| Resource Group | AVM Resource Module for Resource Group |
Azure Quickstart Samples
The following Azure Quickstart templates contain Bicep samples for deploying this resource type.
| Bicep File | Description |
|---|---|
| Configure Deployment Environments service | This template provides a way to configure Deployment Environments. |
| Create a new Datadog Organization | This template creates a new Datadog - An Azure Native ISV Service resource and a Datadog organization to monitor resources in your subscription. |
| Create a resourceGroup | This template is a subscription level template that will create a resourceGroup. Currently, this template can be deployed via the Azure Portal. |
| Create a resourceGroup, apply a lock and RBAC | This template is a subscription level template that will create a resourceGroup, apply a lock the the resourceGroup and assign contributor permssions to the supplied principalId. Currently, this template cannot be deployed via the Azure Portal. |
| Create a subscription, resourceGroup and storageAccount | This template is a management group template that will create a subscription, a resourceGroup and a storageAccount in the same template. It can be used for an Enterprise Agreement billing mode only. The official documentation shows modifications needed for other types of accounts. |
| 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. |
ARM template resource definition
The resourceGroups 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.Resources/resourceGroups resource, add the following JSON to your template.
{
"type": "Microsoft.Resources/resourceGroups",
"apiVersion": "2020-06-01",
"name": "string",
"location": "string",
"managedBy": "string",
"properties": {
},
"tags": {
"{customized property}": "string"
}
}
Property Values
Microsoft.Resources/resourceGroups
| Name | Description | Value |
|---|---|---|
| apiVersion | The api version | '2020-06-01' |
| location | The location of the resource group. It cannot be changed after the resource group has been created. It must be one of the supported Azure locations. | string (required) |
| managedBy | The ID of the resource that manages this resource group. | string |
| name | The resource name | string Constraints: Min length = 1 Max length = 90 (required) |
| properties | The resource group properties. | ResourceGroupProperties |
| tags | Resource tags | Dictionary of tag names and values. See Tags in templates |
| type | The resource type | 'Microsoft.Resources/resourceGroups' |
ResourceGroupProperties
| Name | Description | Value |
|---|
ResourceGroupTags
| Name | Description | Value |
|---|
Usage Examples
Azure Quickstart Templates
The following Azure Quickstart templates deploy this resource type.
| Template | Description |
|---|---|
| Configure Deployment Environments service |
This template provides a way to configure Deployment Environments. |
| Create a new Datadog Organization |
This template creates a new Datadog - An Azure Native ISV Service resource and a Datadog organization to monitor resources in your subscription. |
| Create a resourceGroup |
This template is a subscription level template that will create a resourceGroup. Currently, this template can be deployed via the Azure Portal. |
| Create a resourceGroup, apply a lock and RBAC |
This template is a subscription level template that will create a resourceGroup, apply a lock the the resourceGroup and assign contributor permssions to the supplied principalId. Currently, this template cannot be deployed via the Azure Portal. |
| Create a subscription, resourceGroup and storageAccount |
This template is a management group template that will create a subscription, a resourceGroup and a storageAccount in the same template. It can be used for an Enterprise Agreement billing mode only. The official documentation shows modifications needed for other types of accounts. |
| 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. |
Terraform (AzAPI provider) resource definition
The resourceGroups 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.Resources/resourceGroups resource, add the following Terraform to your template.
resource "azapi_resource" "symbolicname" {
type = "Microsoft.Resources/resourceGroups@2020-06-01"
name = "string"
parent_id = "string"
location = "string"
tags = {
{customized property} = "string"
}
body = {
managedBy = "string"
properties = {
}
}
}
Property Values
Microsoft.Resources/resourceGroups
| Name | Description | Value |
|---|---|---|
| location | The location of the resource group. It cannot be changed after the resource group has been created. It must be one of the supported Azure locations. | string (required) |
| managedBy | The ID of the resource that manages this resource group. | string |
| name | The resource name | string Constraints: Min length = 1 Max length = 90 (required) |
| parent_id | The ID of the resource to apply this extension resource to. | string (required) |
| properties | The resource group properties. | ResourceGroupProperties |
| tags | Resource tags | Dictionary of tag names and values. |
| type | The resource type | "Microsoft.Resources/resourceGroups@2020-06-01" |
ResourceGroupProperties
| Name | Description | Value |
|---|
ResourceGroupTags
| Name | Description | Value |
|---|
Usage Examples
Terraform Samples
A basic example of deploying Resource Group.
terraform {
required_providers {
azapi = {
source = "Azure/azapi"
}
}
}
provider "azapi" {
skip_provider_registration = false
}
variable "resource_name" {
type = string
default = "acctest0001"
}
variable "location" {
type = string
default = "westeurope"
}
resource "azapi_resource" "resourceGroup" {
type = "Microsoft.Resources/resourceGroups@2020-06-01"
name = var.resource_name
location = var.location
}
Azure Verified Modules
The following Azure Verified Modules can be used to deploy this resource type.
| Module | Description |
|---|---|
| Resource Group | AVM Resource Module for Resource Group |