Microsoft.Compute capacityReservationGroups/capacityReservations 2025-04-01

Bicep resource definition

The capacityReservationGroups/capacityReservations 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/capacityReservations resource, add the following Bicep to your template.

resource symbolicname 'Microsoft.Compute/capacityReservationGroups/capacityReservations@2025-04-01' = {
  parent: resourceSymbolicName
  location: 'string'
  name: 'string'
  properties: {
    scheduleProfile: {
      end: 'string'
      start: 'string'
    }
  }
  sku: {
    capacity: int
    name: 'string'
    tier: 'string'
  }
  tags: {
    {customized property}: 'string'
  }
  zones: [
    'string'
  ]
}

Property Values

Microsoft.Compute/capacityReservationGroups/capacityReservations

Name Description Value
location The geo-location where the resource lives string (required)
name The resource name string (required)
parent In Bicep, you can specify the parent resource for a child resource. You only need to add this property when the child resource is declared outside of the parent resource.

For more information, see Child resource outside parent resource.
Symbolic name for resource of type: capacityReservationGroups
properties Properties of the Capacity reservation. CapacityReservationProperties
sku SKU of the resource for which capacity needs be reserved. The SKU name and capacity is required to be set. For Block capacity reservations, sku.capacity can only accept values 1, 2, 4, 8, 16, 32, 64. Currently VM Skus with the capability called 'CapacityReservationSupported' set to true are supported. When 'CapacityReservationSupported' is true, the SKU capability also specifies the 'SupportedCapacityReservationTypes', which lists the types of capacity reservations (such as Targeted or Block) that the SKU supports. Refer to List Microsoft.Compute SKUs in a region (/rest/api/compute/resourceskus/list) for supported values. Sku (required)
tags Resource tags Dictionary of tag names and values. See Tags in templates
zones The availability zones. string[]

CapacityReservationProperties

Name Description Value
scheduleProfile Defines the schedule for Block-type capacity reservations. Specifies the schedule during which capacity reservation is active and VM or VMSS resource can be allocated using reservation. This property is required and only supported when the capacity reservation group type is 'Block'. The scheduleProfile, start, and end fields are immutable after creation. Minimum API version: 2025-04-01. Please refer to https://aka.ms/blockcapacityreservation for more details. ScheduleProfile

ScheduleProfile

Name Description Value
end The required end date for block capacity reservations. Must be after the start date, with a duration of either 1–14 whole days or 3–26 whole weeks. Example: 2025-06-28. string
start The required start date for block capacity reservations. Must be today or within 56 days in the future. For same-day scheduling, requests must be submitted before 11:30 AM UTC. Example: 2025-06-27. string

Sku

Name Description Value
capacity Specifies the number of virtual machines in the scale set. int
name The sku name. string
tier Specifies the tier of virtual machines in a scale set.

Possible Values:

Standard

Basic
string

TrackedResourceTags

Name Description Value

Usage Examples

Bicep Samples

A basic example of deploying Capacity Reservation within a Capacity Reservation Group.

param resourceName string = 'acctest0001'
param location string = 'westus'

resource capacityReservationGroup 'Microsoft.Compute/capacityReservationGroups@2022-03-01' = {
  name: '${resourceName}-ccrg'
  location: location
}

resource capacityReservation 'Microsoft.Compute/capacityReservationGroups/capacityReservations@2022-03-01' = {
  parent: capacityReservationGroup
  name: '${resourceName}-ccr'
  location: location
  sku: {
    capacity: 2
    name: 'Standard_F2'
  }
}

ARM template resource definition

The capacityReservationGroups/capacityReservations 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/capacityReservations resource, add the following JSON to your template.

{
  "type": "Microsoft.Compute/capacityReservationGroups/capacityReservations",
  "apiVersion": "2025-04-01",
  "name": "string",
  "location": "string",
  "properties": {
    "scheduleProfile": {
      "end": "string",
      "start": "string"
    }
  },
  "sku": {
    "capacity": "int",
    "name": "string",
    "tier": "string"
  },
  "tags": {
    "{customized property}": "string"
  },
  "zones": [ "string" ]
}

Property Values

Microsoft.Compute/capacityReservationGroups/capacityReservations

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 Properties of the Capacity reservation. CapacityReservationProperties
sku SKU of the resource for which capacity needs be reserved. The SKU name and capacity is required to be set. For Block capacity reservations, sku.capacity can only accept values 1, 2, 4, 8, 16, 32, 64. Currently VM Skus with the capability called 'CapacityReservationSupported' set to true are supported. When 'CapacityReservationSupported' is true, the SKU capability also specifies the 'SupportedCapacityReservationTypes', which lists the types of capacity reservations (such as Targeted or Block) that the SKU supports. Refer to List Microsoft.Compute SKUs in a region (/rest/api/compute/resourceskus/list) for supported values. Sku (required)
tags Resource tags Dictionary of tag names and values. See Tags in templates
type The resource type 'Microsoft.Compute/capacityReservationGroups/capacityReservations'
zones The availability zones. string[]

CapacityReservationProperties

Name Description Value
scheduleProfile Defines the schedule for Block-type capacity reservations. Specifies the schedule during which capacity reservation is active and VM or VMSS resource can be allocated using reservation. This property is required and only supported when the capacity reservation group type is 'Block'. The scheduleProfile, start, and end fields are immutable after creation. Minimum API version: 2025-04-01. Please refer to https://aka.ms/blockcapacityreservation for more details. ScheduleProfile

ScheduleProfile

Name Description Value
end The required end date for block capacity reservations. Must be after the start date, with a duration of either 1–14 whole days or 3–26 whole weeks. Example: 2025-06-28. string
start The required start date for block capacity reservations. Must be today or within 56 days in the future. For same-day scheduling, requests must be submitted before 11:30 AM UTC. Example: 2025-06-27. string

Sku

Name Description Value
capacity Specifies the number of virtual machines in the scale set. int
name The sku name. string
tier Specifies the tier of virtual machines in a scale set.

Possible Values:

Standard

Basic
string

TrackedResourceTags

Name Description Value

Usage Examples

Terraform (AzAPI provider) resource definition

The capacityReservationGroups/capacityReservations resource type can be deployed with operations that target:

  • Resource groups

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

Resource format

To create a Microsoft.Compute/capacityReservationGroups/capacityReservations resource, add the following Terraform to your template.

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.Compute/capacityReservationGroups/capacityReservations@2025-04-01"
  name = "string"
  parent_id = "string"
  location = "string"
  tags = {
    {customized property} = "string"
  }
  body = {
    properties = {
      scheduleProfile = {
        end = "string"
        start = "string"
      }
    }
    sku = {
      capacity = int
      name = "string"
      tier = "string"
    }
    zones = [
      "string"
    ]
  }
}

Property Values

Microsoft.Compute/capacityReservationGroups/capacityReservations

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 that is the parent for this resource. ID for resource of type: capacityReservationGroups
properties Properties of the Capacity reservation. CapacityReservationProperties
sku SKU of the resource for which capacity needs be reserved. The SKU name and capacity is required to be set. For Block capacity reservations, sku.capacity can only accept values 1, 2, 4, 8, 16, 32, 64. Currently VM Skus with the capability called 'CapacityReservationSupported' set to true are supported. When 'CapacityReservationSupported' is true, the SKU capability also specifies the 'SupportedCapacityReservationTypes', which lists the types of capacity reservations (such as Targeted or Block) that the SKU supports. Refer to List Microsoft.Compute SKUs in a region (/rest/api/compute/resourceskus/list) for supported values. Sku (required)
tags Resource tags Dictionary of tag names and values.
type The resource type "Microsoft.Compute/capacityReservationGroups/capacityReservations@2025-04-01"
zones The availability zones. string[]

CapacityReservationProperties

Name Description Value
scheduleProfile Defines the schedule for Block-type capacity reservations. Specifies the schedule during which capacity reservation is active and VM or VMSS resource can be allocated using reservation. This property is required and only supported when the capacity reservation group type is 'Block'. The scheduleProfile, start, and end fields are immutable after creation. Minimum API version: 2025-04-01. Please refer to https://aka.ms/blockcapacityreservation for more details. ScheduleProfile

ScheduleProfile

Name Description Value
end The required end date for block capacity reservations. Must be after the start date, with a duration of either 1–14 whole days or 3–26 whole weeks. Example: 2025-06-28. string
start The required start date for block capacity reservations. Must be today or within 56 days in the future. For same-day scheduling, requests must be submitted before 11:30 AM UTC. Example: 2025-06-27. string

Sku

Name Description Value
capacity Specifies the number of virtual machines in the scale set. int
name The sku name. string
tier Specifies the tier of virtual machines in a scale set.

Possible Values:

Standard

Basic
string

TrackedResourceTags

Name Description Value

Usage Examples

Terraform Samples

A basic example of deploying Capacity Reservation within a 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 = "westus"
}

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}-ccrg"
  location  = var.location
}

resource "azapi_resource" "capacityReservation" {
  type      = "Microsoft.Compute/capacityReservationGroups/capacityReservations@2022-03-01"
  parent_id = azapi_resource.capacityReservationGroup.id
  name      = "${var.resource_name}-ccr"
  location  = var.location
  body = {
    sku = {
      capacity = 2
      name     = "Standard_F2"
    }
  }
}