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 capacityReservationGroups 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.Compute/capacityReservationGroups resource, add the following Bicep to your template.
resource symbolicname 'Microsoft.Compute/capacityReservationGroups@2025-04-01' = {
scope: resourceSymbolicName or scope
___location: 'string'
name: 'string'
properties: {
reservationType: 'string'
sharingProfile: {
subscriptionIds: [
{
id: 'string'
}
]
}
}
tags: {
{customized property}: 'string'
}
zones: [
'string'
]
}
Property Values
Microsoft.Compute/capacityReservationGroups
| Name | Description | Value |
|---|---|---|
| ___location | The geo-___location where the resource lives | string (required) |
| name | The resource name | string (required) |
| properties | capacity reservation group Properties. | CapacityReservationGroupProperties |
| 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 |
| zones | The availability zones. | string[] |
CapacityReservationGroupProperties
| Name | Description | Value |
|---|---|---|
| reservationType | Indicates the type of capacity reservation. Allowed values are 'Block' for block capacity reservations and 'Targeted' for reservations that enable a VM to consume a specific capacity reservation when a capacity reservation group is provided. The reservation type is immutable and cannot be changed after it is assigned. | 'Block' 'Targeted' |
| sharingProfile | Specifies the settings to enable sharing across subscriptions for the capacity reservation group resource. The capacity reservation group resource can generally be shared across subscriptions belonging to a single Azure AAD tenant or across AAD tenants if there is a trust relationship established between the tenants. Block capacity reservation does not support sharing across subscriptions. Note: Minimum api-version: 2023-09-01. Please refer to https://aka.ms/computereservationsharing for more details. | ResourceSharingProfile |
ResourceSharingProfile
| Name | Description | Value |
|---|---|---|
| subscriptionIds | Specifies an array of subscription resource IDs that capacity reservation group is shared with. Block Capacity Reservations does not support sharing across subscriptions. Note: Minimum api-version: 2023-09-01. Please refer to https://aka.ms/computereservationsharing for more details. | SubResource[] |
SubResource
| Name | Description | Value |
|---|---|---|
| id | Resource Id | string |
TrackedResourceTags
| Name | Description | Value |
|---|
ARM template resource definition
The capacityReservationGroups 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.Compute/capacityReservationGroups resource, add the following JSON to your template.
{
"type": "Microsoft.Compute/capacityReservationGroups",
"apiVersion": "2025-04-01",
"name": "string",
"___location": "string",
"properties": {
"reservationType": "string",
"sharingProfile": {
"subscriptionIds": [
{
"id": "string"
}
]
}
},
"tags": {
"{customized property}": "string"
},
"zones": [ "string" ]
}
Property Values
Microsoft.Compute/capacityReservationGroups
| Name | Description | Value |
|---|---|---|
| apiVersion | The api version | '2025-04-01' |
| ___location | The geo-___location where the resource lives | string (required) |
| name | The resource name | string (required) |
| properties | capacity reservation group Properties. | CapacityReservationGroupProperties |
| tags | Resource tags | Dictionary of tag names and values. See Tags in templates |
| type | The resource type | 'Microsoft.Compute/capacityReservationGroups' |
| zones | The availability zones. | string[] |
CapacityReservationGroupProperties
| Name | Description | Value |
|---|---|---|
| reservationType | Indicates the type of capacity reservation. Allowed values are 'Block' for block capacity reservations and 'Targeted' for reservations that enable a VM to consume a specific capacity reservation when a capacity reservation group is provided. The reservation type is immutable and cannot be changed after it is assigned. | 'Block' 'Targeted' |
| sharingProfile | Specifies the settings to enable sharing across subscriptions for the capacity reservation group resource. The capacity reservation group resource can generally be shared across subscriptions belonging to a single Azure AAD tenant or across AAD tenants if there is a trust relationship established between the tenants. Block capacity reservation does not support sharing across subscriptions. Note: Minimum api-version: 2023-09-01. Please refer to https://aka.ms/computereservationsharing for more details. | ResourceSharingProfile |
ResourceSharingProfile
| Name | Description | Value |
|---|---|---|
| subscriptionIds | Specifies an array of subscription resource IDs that capacity reservation group is shared with. Block Capacity Reservations does not support sharing across subscriptions. Note: Minimum api-version: 2023-09-01. Please refer to https://aka.ms/computereservationsharing for more details. | SubResource[] |
SubResource
| Name | Description | Value |
|---|---|---|
| id | Resource Id | string |
TrackedResourceTags
| Name | Description | Value |
|---|
Usage Examples
Terraform (AzAPI provider) resource definition
The capacityReservationGroups 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.Compute/capacityReservationGroups resource, add the following Terraform to your template.
resource "azapi_resource" "symbolicname" {
type = "Microsoft.Compute/capacityReservationGroups@2025-04-01"
name = "string"
parent_id = "string"
___location = "string"
tags = {
{customized property} = "string"
}
body = {
properties = {
reservationType = "string"
sharingProfile = {
subscriptionIds = [
{
id = "string"
}
]
}
}
zones = [
"string"
]
}
}
Property Values
Microsoft.Compute/capacityReservationGroups
| Name | Description | Value |
|---|---|---|
| ___location | The geo-___location where the resource lives | string (required) |
| name | The resource name | string (required) |
| parent_id | The ID of the resource to apply this extension resource to. | string (required) |
| properties | capacity reservation group Properties. | CapacityReservationGroupProperties |
| tags | Resource tags | Dictionary of tag names and values. |
| type | The resource type | "Microsoft.Compute/capacityReservationGroups@2025-04-01" |
| zones | The availability zones. | string[] |
CapacityReservationGroupProperties
| Name | Description | Value |
|---|---|---|
| reservationType | Indicates the type of capacity reservation. Allowed values are 'Block' for block capacity reservations and 'Targeted' for reservations that enable a VM to consume a specific capacity reservation when a capacity reservation group is provided. The reservation type is immutable and cannot be changed after it is assigned. | 'Block' 'Targeted' |
| sharingProfile | Specifies the settings to enable sharing across subscriptions for the capacity reservation group resource. The capacity reservation group resource can generally be shared across subscriptions belonging to a single Azure AAD tenant or across AAD tenants if there is a trust relationship established between the tenants. Block capacity reservation does not support sharing across subscriptions. Note: Minimum api-version: 2023-09-01. Please refer to https://aka.ms/computereservationsharing for more details. | ResourceSharingProfile |
ResourceSharingProfile
| Name | Description | Value |
|---|---|---|
| subscriptionIds | Specifies an array of subscription resource IDs that capacity reservation group is shared with. Block Capacity Reservations does not support sharing across subscriptions. Note: Minimum api-version: 2023-09-01. Please refer to https://aka.ms/computereservationsharing for more details. | SubResource[] |
SubResource
| Name | Description | Value |
|---|---|---|
| id | Resource Id | string |
TrackedResourceTags
| Name | Description | Value |
|---|
Usage Examples
Terraform Samples
A basic example of deploying Capacity Reservation 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
}
resource "azapi_resource" "capacityReservationGroup" {
type = "Microsoft.Compute/capacityReservationGroups@2022-03-01"
parent_id = azapi_resource.resourceGroup.id
name = var.resource_name
___location = var.___location
schema_validation_enabled = false
response_export_values = ["*"]
}