The operation that retrieves information about the capacity reservation.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}?api-version=2026-04-01
With optional parameters:
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/capacityReservations/{capacityReservationName}?api-version=2026-04-01&$expand=instanceView
URI Parameters
| Name |
In |
Required |
Type |
Description |
|
capacityReservationGroupName
|
path |
True
|
string
|
The name of the capacity reservation group.
|
|
capacityReservationName
|
path |
True
|
string
|
The name of the capacity reservation.
|
|
resourceGroupName
|
path |
True
|
string
minLength: 1 maxLength: 90
|
The name of the resource group. The name is case insensitive.
|
|
subscriptionId
|
path |
True
|
string
minLength: 1
|
The ID of the target subscription.
|
|
api-version
|
query |
True
|
string
minLength: 1
|
The API version to use for this operation.
|
|
$expand
|
query |
|
CapacityReservationInstanceViewTypes
|
The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime properties of the capacity reservation that is managed by the platform and can change outside of control plane operations.
|
Responses
| Name |
Type |
Description |
|
200 OK
|
CapacityReservation
|
Azure operation completed successfully.
|
|
Other Status Codes
|
CloudError
|
An unexpected error response.
|
Security
azure_auth
Azure Active Directory OAuth2 Flow.
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
| Name |
Description |
|
user_impersonation
|
impersonate your user account
|
Examples
Get a block capacity reservation.
Sample request
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/blockCapacityReservationGroup/capacityReservations/blockCapacityReservation?api-version=2026-04-01&$expand=instanceView
import com.azure.resourcemanager.compute.models.CapacityReservationInstanceViewTypes;
/**
* Samples for CapacityReservations Get.
*/
public final class Main {
/*
* x-ms-original-file: 2026-04-01/capacityReservationExamples/BlockCapacityReservation_Get.json
*/
/**
* Sample code: Get a block capacity reservation.
*
* @param manager Entry point to ComputeManager.
*/
public static void getABlockCapacityReservation(com.azure.resourcemanager.compute.ComputeManager manager) {
manager.serviceClient().getCapacityReservations().getWithResponse("myResourceGroup",
"blockCapacityReservationGroup", "blockCapacityReservation",
CapacityReservationInstanceViewTypes.INSTANCE_VIEW, com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.compute import ComputeManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-compute
# USAGE
python block_capacity_reservation_get.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ComputeManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.capacity_reservations.get(
resource_group_name="myResourceGroup",
capacity_reservation_group_name="blockCapacityReservationGroup",
capacity_reservation_name="blockCapacityReservation",
)
print(response)
# x-ms-original-file: 2026-04-01/capacityReservationExamples/BlockCapacityReservation_Get.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcompute_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v8"
)
// Generated from example definition: 2026-04-01/capacityReservationExamples/BlockCapacityReservation_Get.json
func ExampleCapacityReservationsClient_Get_getABlockCapacityReservation() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcompute.NewClientFactory("{subscriptionId}", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewCapacityReservationsClient().Get(ctx, "myResourceGroup", "blockCapacityReservationGroup", "blockCapacityReservation", &armcompute.CapacityReservationsClientGetOptions{
Expand: to.Ptr(armcompute.CapacityReservationInstanceViewTypesInstanceView)})
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcompute.CapacityReservationsClientGetResponse{
// CapacityReservation: armcompute.CapacityReservation{
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/blockCapacityReservationGroup/capacityReservations/blockCapacityReservation"),
// Properties: &armcompute.CapacityReservationProperties{
// PlatformFaultDomainCount: to.Ptr[int32](3),
// ReservationID: to.Ptr("{GUID}"),
// ProvisioningTime: to.Ptr(time.Date(2021, time.June, 27, 1, 2, 38, 313846900, time.UTC)),
// VirtualMachinesAssociated: []*armcompute.SubResourceReadOnly{
// {
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM1"),
// },
// {
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM2"),
// },
// {
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM3"),
// },
// },
// ProvisioningState: to.Ptr("Succeeded"),
// InstanceView: &armcompute.CapacityReservationInstanceView{
// UtilizationInfo: &armcompute.CapacityReservationUtilization{
// CurrentCapacity: to.Ptr[int32](5),
// VirtualMachinesAllocated: []*armcompute.SubResourceReadOnly{
// {
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM1"),
// },
// {
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM2"),
// },
// },
// },
// Statuses: []*armcompute.InstanceViewStatus{
// {
// Code: to.Ptr("ProvisioningState/succeeded"),
// Level: to.Ptr(armcompute.StatusLevelTypesInfo),
// DisplayStatus: to.Ptr("Provisioning succeeded"),
// },
// },
// },
// ScheduleProfile: &armcompute.ScheduleProfile{
// Start: to.Ptr("2025-08-01T12:00:00Z"),
// End: to.Ptr("2025-08-02T11:30:00Z"),
// },
// TimeCreated: to.Ptr(time.Date(2021, time.June, 27, 1, 2, 38, 313846900, time.UTC)),
// },
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// "department": to.Ptr("HR"),
// },
// SKU: &armcompute.SKU{
// Name: to.Ptr("Standard_ND96isr_H100_v5"),
// Capacity: to.Ptr[int64](1),
// },
// Zones: []*string{
// to.Ptr("1"),
// },
// Name: to.Ptr("blockCapacityReservation"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ComputeManagementClient } = require("@azure/arm-compute");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to the operation that retrieves information about the capacity reservation.
*
* @summary the operation that retrieves information about the capacity reservation.
* x-ms-original-file: 2026-04-01/capacityReservationExamples/BlockCapacityReservation_Get.json
*/
async function getABlockCapacityReservation() {
const credential = new DefaultAzureCredential();
const subscriptionId = "{subscriptionId}";
const client = new ComputeManagementClient(credential, subscriptionId);
const result = await client.capacityReservations.get(
"myResourceGroup",
"blockCapacityReservationGroup",
"blockCapacityReservation",
{ expand: "instanceView" },
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample response
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/blockCapacityReservationGroup/capacityReservations/blockCapacityReservation",
"properties": {
"platformFaultDomainCount": 3,
"reservationId": "{GUID}",
"provisioningTime": "2021-06-27T01:02:38.3138469+00:00",
"virtualMachinesAssociated": [
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM1"
},
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM2"
},
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM3"
}
],
"provisioningState": "Succeeded",
"instanceView": {
"utilizationInfo": {
"currentCapacity": 5,
"virtualMachinesAllocated": [
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM1"
},
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM2"
}
]
},
"statuses": [
{
"code": "ProvisioningState/succeeded",
"level": "Info",
"displayStatus": "Provisioning succeeded"
}
]
},
"scheduleProfile": {
"start": "2025-08-01T12:00:00Z",
"end": "2025-08-02T11:30:00Z"
},
"timeCreated": "2021-06-27T01:02:38.3138469+00:00"
},
"location": "westus",
"tags": {
"department": "HR"
},
"sku": {
"name": "Standard_ND96isr_H100_v5",
"capacity": 1
},
"zones": [
"1"
],
"name": "blockCapacityReservation"
}
Get a capacity reservation.
Sample request
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/myCapacityReservationGroup/capacityReservations/myCapacityReservation?api-version=2026-04-01&$expand=instanceView
import com.azure.resourcemanager.compute.models.CapacityReservationInstanceViewTypes;
/**
* Samples for CapacityReservations Get.
*/
public final class Main {
/*
* x-ms-original-file: 2026-04-01/capacityReservationExamples/CapacityReservation_Get.json
*/
/**
* Sample code: Get a capacity reservation.
*
* @param manager Entry point to ComputeManager.
*/
public static void getACapacityReservation(com.azure.resourcemanager.compute.ComputeManager manager) {
manager.serviceClient().getCapacityReservations().getWithResponse("myResourceGroup",
"myCapacityReservationGroup", "myCapacityReservation", CapacityReservationInstanceViewTypes.INSTANCE_VIEW,
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.compute import ComputeManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-compute
# USAGE
python capacity_reservation_get.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ComputeManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.capacity_reservations.get(
resource_group_name="myResourceGroup",
capacity_reservation_group_name="myCapacityReservationGroup",
capacity_reservation_name="myCapacityReservation",
)
print(response)
# x-ms-original-file: 2026-04-01/capacityReservationExamples/CapacityReservation_Get.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcompute_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v8"
)
// Generated from example definition: 2026-04-01/capacityReservationExamples/CapacityReservation_Get.json
func ExampleCapacityReservationsClient_Get_getACapacityReservation() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcompute.NewClientFactory("{subscriptionId}", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewCapacityReservationsClient().Get(ctx, "myResourceGroup", "myCapacityReservationGroup", "myCapacityReservation", &armcompute.CapacityReservationsClientGetOptions{
Expand: to.Ptr(armcompute.CapacityReservationInstanceViewTypesInstanceView)})
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcompute.CapacityReservationsClientGetResponse{
// CapacityReservation: armcompute.CapacityReservation{
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/myCapacityReservationGroup/capacityReservations/myCapacityReservation"),
// Properties: &armcompute.CapacityReservationProperties{
// PlatformFaultDomainCount: to.Ptr[int32](3),
// ReservationID: to.Ptr("{GUID}"),
// ProvisioningTime: to.Ptr(time.Date(2021, time.June, 27, 1, 2, 38, 313846900, time.UTC)),
// VirtualMachinesAssociated: []*armcompute.SubResourceReadOnly{
// {
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM1"),
// },
// {
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM2"),
// },
// {
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM3"),
// },
// },
// ProvisioningState: to.Ptr("Succeeded"),
// InstanceView: &armcompute.CapacityReservationInstanceView{
// UtilizationInfo: &armcompute.CapacityReservationUtilization{
// CurrentCapacity: to.Ptr[int32](5),
// VirtualMachinesAllocated: []*armcompute.SubResourceReadOnly{
// {
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM1"),
// },
// {
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM2"),
// },
// },
// },
// Statuses: []*armcompute.InstanceViewStatus{
// {
// Code: to.Ptr("ProvisioningState/succeeded"),
// Level: to.Ptr(armcompute.StatusLevelTypesInfo),
// DisplayStatus: to.Ptr("Provisioning succeeded"),
// },
// },
// },
// TimeCreated: to.Ptr(time.Date(2021, time.June, 27, 1, 2, 38, 313846900, time.UTC)),
// },
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// "department": to.Ptr("HR"),
// },
// SKU: &armcompute.SKU{
// Name: to.Ptr("Standard_DS1_v2"),
// Capacity: to.Ptr[int64](4),
// },
// Zones: []*string{
// to.Ptr("1"),
// },
// Name: to.Ptr("myCapacityReservation"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ComputeManagementClient } = require("@azure/arm-compute");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to the operation that retrieves information about the capacity reservation.
*
* @summary the operation that retrieves information about the capacity reservation.
* x-ms-original-file: 2026-04-01/capacityReservationExamples/CapacityReservation_Get.json
*/
async function getACapacityReservation() {
const credential = new DefaultAzureCredential();
const subscriptionId = "{subscriptionId}";
const client = new ComputeManagementClient(credential, subscriptionId);
const result = await client.capacityReservations.get(
"myResourceGroup",
"myCapacityReservationGroup",
"myCapacityReservation",
{ expand: "instanceView" },
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample response
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/myCapacityReservationGroup/capacityReservations/myCapacityReservation",
"properties": {
"platformFaultDomainCount": 3,
"reservationId": "{GUID}",
"provisioningTime": "2021-06-27T01:02:38.3138469+00:00",
"virtualMachinesAssociated": [
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM1"
},
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM2"
},
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM3"
}
],
"provisioningState": "Succeeded",
"instanceView": {
"utilizationInfo": {
"currentCapacity": 5,
"virtualMachinesAllocated": [
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM1"
},
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM2"
}
]
},
"statuses": [
{
"code": "ProvisioningState/succeeded",
"level": "Info",
"displayStatus": "Provisioning succeeded"
}
]
},
"timeCreated": "2021-06-27T01:02:38.3138469+00:00"
},
"location": "westus",
"tags": {
"department": "HR"
},
"sku": {
"name": "Standard_DS1_v2",
"capacity": 4
},
"zones": [
"1"
],
"name": "myCapacityReservation"
}
Get a Future capacity reservation.
Sample request
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/futureCapacityReservationGroup/capacityReservations/futureCapacityReservation?api-version=2026-04-01&$expand=instanceView
import com.azure.resourcemanager.compute.models.CapacityReservationInstanceViewTypes;
/**
* Samples for CapacityReservations Get.
*/
public final class Main {
/*
* x-ms-original-file: 2026-04-01/capacityReservationExamples/FutureCapacityReservation_Get.json
*/
/**
* Sample code: Get a Future capacity reservation.
*
* @param manager Entry point to ComputeManager.
*/
public static void getAFutureCapacityReservation(com.azure.resourcemanager.compute.ComputeManager manager) {
manager.serviceClient().getCapacityReservations().getWithResponse("myResourceGroup",
"futureCapacityReservationGroup", "futureCapacityReservation",
CapacityReservationInstanceViewTypes.INSTANCE_VIEW, com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.compute import ComputeManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-compute
# USAGE
python future_capacity_reservation_get.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ComputeManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.capacity_reservations.get(
resource_group_name="myResourceGroup",
capacity_reservation_group_name="futureCapacityReservationGroup",
capacity_reservation_name="futureCapacityReservation",
)
print(response)
# x-ms-original-file: 2026-04-01/capacityReservationExamples/FutureCapacityReservation_Get.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcompute_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v8"
)
// Generated from example definition: 2026-04-01/capacityReservationExamples/FutureCapacityReservation_Get.json
func ExampleCapacityReservationsClient_Get_getAFutureCapacityReservation() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcompute.NewClientFactory("{subscriptionId}", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewCapacityReservationsClient().Get(ctx, "myResourceGroup", "futureCapacityReservationGroup", "futureCapacityReservation", &armcompute.CapacityReservationsClientGetOptions{
Expand: to.Ptr(armcompute.CapacityReservationInstanceViewTypesInstanceView)})
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcompute.CapacityReservationsClientGetResponse{
// CapacityReservation: armcompute.CapacityReservation{
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/futureCapacityReservationGroup/capacityReservations/futureCapacityReservation"),
// Properties: &armcompute.CapacityReservationProperties{
// PlatformFaultDomainCount: to.Ptr[int32](3),
// ReservationID: to.Ptr("{GUID}"),
// ProvisioningTime: to.Ptr(time.Date(2021, time.June, 27, 1, 2, 38, 313846900, time.UTC)),
// VirtualMachinesAssociated: []*armcompute.SubResourceReadOnly{
// {
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM1"),
// },
// {
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM2"),
// },
// {
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM3"),
// },
// },
// ProvisioningState: to.Ptr("Succeeded"),
// InstanceView: &armcompute.CapacityReservationInstanceView{
// UtilizationInfo: &armcompute.CapacityReservationUtilization{
// CurrentCapacity: to.Ptr[int32](4),
// VirtualMachinesAllocated: []*armcompute.SubResourceReadOnly{
// {
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM1"),
// },
// {
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM2"),
// },
// },
// },
// Statuses: []*armcompute.InstanceViewStatus{
// {
// Code: to.Ptr("ProvisioningState/succeeded"),
// Level: to.Ptr(armcompute.StatusLevelTypesInfo),
// DisplayStatus: to.Ptr("Provisioning succeeded"),
// },
// },
// ReservationStateInfo: &armcompute.CapacityReservationStateInfo{
// ReservationState: to.Ptr(armcompute.ReservationStateLive),
// },
// },
// ScheduleProfile: &armcompute.ScheduleProfile{
// Start: to.Ptr("2026-08-01T12:00:00Z"),
// MinimumCommitmentDays: to.Ptr[int32](30),
// ModifiableUntil: to.Ptr(time.Date(2026, time.June, 6, 12, 0, 0, 0, time.UTC)),
// },
// TimeCreated: to.Ptr(time.Date(2021, time.June, 27, 1, 2, 38, 313846900, time.UTC)),
// },
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// "department": to.Ptr("HR"),
// },
// SKU: &armcompute.SKU{
// Name: to.Ptr("Standard_DS1_v2"),
// Capacity: to.Ptr[int64](4),
// },
// Zones: []*string{
// to.Ptr("1"),
// },
// Name: to.Ptr("futureCapacityReservation"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ComputeManagementClient } = require("@azure/arm-compute");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to the operation that retrieves information about the capacity reservation.
*
* @summary the operation that retrieves information about the capacity reservation.
* x-ms-original-file: 2026-04-01/capacityReservationExamples/FutureCapacityReservation_Get.json
*/
async function getAFutureCapacityReservation() {
const credential = new DefaultAzureCredential();
const subscriptionId = "{subscriptionId}";
const client = new ComputeManagementClient(credential, subscriptionId);
const result = await client.capacityReservations.get(
"myResourceGroup",
"futureCapacityReservationGroup",
"futureCapacityReservation",
{ expand: "instanceView" },
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample response
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/futureCapacityReservationGroup/capacityReservations/futureCapacityReservation",
"properties": {
"platformFaultDomainCount": 3,
"reservationId": "{GUID}",
"provisioningTime": "2021-06-27T01:02:38.3138469+00:00",
"virtualMachinesAssociated": [
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM1"
},
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM2"
},
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM3"
}
],
"provisioningState": "Succeeded",
"instanceView": {
"utilizationInfo": {
"currentCapacity": 4,
"virtualMachinesAllocated": [
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM1"
},
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM2"
}
]
},
"statuses": [
{
"code": "ProvisioningState/succeeded",
"level": "Info",
"displayStatus": "Provisioning succeeded"
}
],
"reservationStateInfo": {
"reservationState": "Live"
}
},
"scheduleProfile": {
"start": "2026-08-01T12:00:00Z",
"minimumCommitmentDays": 30,
"modifiableUntil": "2026-06-06T12:00:00Z"
},
"timeCreated": "2021-06-27T01:02:38.3138469+00:00"
},
"location": "westus",
"tags": {
"department": "HR"
},
"sku": {
"name": "Standard_DS1_v2",
"capacity": 4
},
"zones": [
"1"
],
"name": "futureCapacityReservation"
}
Get a targeted capacity reservation.
Sample request
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/targetedCapacityReservationGroup/capacityReservations/targetedCapacityReservation?api-version=2026-04-01&$expand=instanceView
import com.azure.resourcemanager.compute.models.CapacityReservationInstanceViewTypes;
/**
* Samples for CapacityReservations Get.
*/
public final class Main {
/*
* x-ms-original-file: 2026-04-01/capacityReservationExamples/TargetedCapacityReservation_Get.json
*/
/**
* Sample code: Get a targeted capacity reservation.
*
* @param manager Entry point to ComputeManager.
*/
public static void getATargetedCapacityReservation(com.azure.resourcemanager.compute.ComputeManager manager) {
manager.serviceClient().getCapacityReservations().getWithResponse("myResourceGroup",
"targetedCapacityReservationGroup", "targetedCapacityReservation",
CapacityReservationInstanceViewTypes.INSTANCE_VIEW, com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.compute import ComputeManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-compute
# USAGE
python targeted_capacity_reservation_get.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ComputeManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.capacity_reservations.get(
resource_group_name="myResourceGroup",
capacity_reservation_group_name="targetedCapacityReservationGroup",
capacity_reservation_name="targetedCapacityReservation",
)
print(response)
# x-ms-original-file: 2026-04-01/capacityReservationExamples/TargetedCapacityReservation_Get.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcompute_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v8"
)
// Generated from example definition: 2026-04-01/capacityReservationExamples/TargetedCapacityReservation_Get.json
func ExampleCapacityReservationsClient_Get_getATargetedCapacityReservation() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcompute.NewClientFactory("{subscriptionId}", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewCapacityReservationsClient().Get(ctx, "myResourceGroup", "targetedCapacityReservationGroup", "targetedCapacityReservation", &armcompute.CapacityReservationsClientGetOptions{
Expand: to.Ptr(armcompute.CapacityReservationInstanceViewTypesInstanceView)})
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcompute.CapacityReservationsClientGetResponse{
// CapacityReservation: armcompute.CapacityReservation{
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/targetedCapacityReservationGroup/capacityReservations/targetedCapacityReservation"),
// Properties: &armcompute.CapacityReservationProperties{
// PlatformFaultDomainCount: to.Ptr[int32](3),
// ReservationID: to.Ptr("{GUID}"),
// ProvisioningTime: to.Ptr(time.Date(2021, time.June, 27, 1, 2, 38, 313846900, time.UTC)),
// VirtualMachinesAssociated: []*armcompute.SubResourceReadOnly{
// {
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM1"),
// },
// {
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM2"),
// },
// {
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM3"),
// },
// },
// ProvisioningState: to.Ptr("Succeeded"),
// InstanceView: &armcompute.CapacityReservationInstanceView{
// UtilizationInfo: &armcompute.CapacityReservationUtilization{
// CurrentCapacity: to.Ptr[int32](5),
// VirtualMachinesAllocated: []*armcompute.SubResourceReadOnly{
// {
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM1"),
// },
// {
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM2"),
// },
// },
// },
// Statuses: []*armcompute.InstanceViewStatus{
// {
// Code: to.Ptr("ProvisioningState/succeeded"),
// Level: to.Ptr(armcompute.StatusLevelTypesInfo),
// DisplayStatus: to.Ptr("Provisioning succeeded"),
// },
// },
// },
// TimeCreated: to.Ptr(time.Date(2021, time.June, 27, 1, 2, 38, 313846900, time.UTC)),
// },
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// "department": to.Ptr("HR"),
// },
// SKU: &armcompute.SKU{
// Name: to.Ptr("Standard_DS1_v2"),
// Capacity: to.Ptr[int64](4),
// },
// Zones: []*string{
// to.Ptr("1"),
// },
// Name: to.Ptr("targetedCapacityReservation"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ComputeManagementClient } = require("@azure/arm-compute");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to the operation that retrieves information about the capacity reservation.
*
* @summary the operation that retrieves information about the capacity reservation.
* x-ms-original-file: 2026-04-01/capacityReservationExamples/TargetedCapacityReservation_Get.json
*/
async function getATargetedCapacityReservation() {
const credential = new DefaultAzureCredential();
const subscriptionId = "{subscriptionId}";
const client = new ComputeManagementClient(credential, subscriptionId);
const result = await client.capacityReservations.get(
"myResourceGroup",
"targetedCapacityReservationGroup",
"targetedCapacityReservation",
{ expand: "instanceView" },
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample response
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/targetedCapacityReservationGroup/capacityReservations/targetedCapacityReservation",
"properties": {
"platformFaultDomainCount": 3,
"reservationId": "{GUID}",
"provisioningTime": "2021-06-27T01:02:38.3138469+00:00",
"virtualMachinesAssociated": [
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM1"
},
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM2"
},
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM3"
}
],
"provisioningState": "Succeeded",
"instanceView": {
"utilizationInfo": {
"currentCapacity": 5,
"virtualMachinesAllocated": [
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM1"
},
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM2"
}
]
},
"statuses": [
{
"code": "ProvisioningState/succeeded",
"level": "Info",
"displayStatus": "Provisioning succeeded"
}
]
},
"timeCreated": "2021-06-27T01:02:38.3138469+00:00"
},
"location": "westus",
"tags": {
"department": "HR"
},
"sku": {
"name": "Standard_DS1_v2",
"capacity": 4
},
"zones": [
"1"
],
"name": "targetedCapacityReservation"
}
Get an open capacity reservation with instance view.
Sample request
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/openCapacityReservationGroup/capacityReservations/openCapacityReservation?api-version=2026-04-01&$expand=instanceView
import com.azure.resourcemanager.compute.models.CapacityReservationInstanceViewTypes;
/**
* Samples for CapacityReservations Get.
*/
public final class Main {
/*
* x-ms-original-file: 2026-04-01/capacityReservationExamples/OpenCapacityReservation_Get.json
*/
/**
* Sample code: Get an open capacity reservation with instance view.
*
* @param manager Entry point to ComputeManager.
*/
public static void
getAnOpenCapacityReservationWithInstanceView(com.azure.resourcemanager.compute.ComputeManager manager) {
manager.serviceClient().getCapacityReservations().getWithResponse("myResourceGroup",
"openCapacityReservationGroup", "openCapacityReservation",
CapacityReservationInstanceViewTypes.INSTANCE_VIEW, com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.compute import ComputeManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-compute
# USAGE
python open_capacity_reservation_get.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ComputeManagementClient(
credential=DefaultAzureCredential(),
subscription_id="SUBSCRIPTION_ID",
)
response = client.capacity_reservations.get(
resource_group_name="myResourceGroup",
capacity_reservation_group_name="openCapacityReservationGroup",
capacity_reservation_name="openCapacityReservation",
)
print(response)
# x-ms-original-file: 2026-04-01/capacityReservationExamples/OpenCapacityReservation_Get.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcompute_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v8"
)
// Generated from example definition: 2026-04-01/capacityReservationExamples/OpenCapacityReservation_Get.json
func ExampleCapacityReservationsClient_Get_getAnOpenCapacityReservationWithInstanceView() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcompute.NewClientFactory("{subscriptionId}", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewCapacityReservationsClient().Get(ctx, "myResourceGroup", "openCapacityReservationGroup", "openCapacityReservation", &armcompute.CapacityReservationsClientGetOptions{
Expand: to.Ptr(armcompute.CapacityReservationInstanceViewTypesInstanceView)})
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armcompute.CapacityReservationsClientGetResponse{
// CapacityReservation: armcompute.CapacityReservation{
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/openCapacityReservationGroup/capacityReservations/openCapacityReservation"),
// Properties: &armcompute.CapacityReservationProperties{
// PlatformFaultDomainCount: to.Ptr[int32](3),
// ReservationID: to.Ptr("{GUID}"),
// ProvisioningTime: to.Ptr(time.Date(2021, time.June, 27, 1, 2, 38, 313846900, time.UTC)),
// ProvisioningState: to.Ptr("Succeeded"),
// InstanceView: &armcompute.CapacityReservationInstanceView{
// UtilizationInfo: &armcompute.CapacityReservationUtilization{
// CurrentCapacity: to.Ptr[int32](10),
// UsedReservedCountBySubscription: map[string]*int32{
// "{subscription-id1}": to.Ptr[int32](3),
// "{subscription-id2}": to.Ptr[int32](2),
// },
// },
// Statuses: []*armcompute.InstanceViewStatus{
// {
// Code: to.Ptr("ProvisioningState/succeeded"),
// Level: to.Ptr(armcompute.StatusLevelTypesInfo),
// DisplayStatus: to.Ptr("Provisioning succeeded"),
// },
// },
// },
// TimeCreated: to.Ptr(time.Date(2021, time.June, 27, 1, 2, 38, 313846900, time.UTC)),
// },
// Location: to.Ptr("westus"),
// Tags: map[string]*string{
// "{tagName}": to.Ptr("{tagValue}"),
// },
// SKU: &armcompute.SKU{
// Name: to.Ptr("Standard_DS1_v2"),
// Capacity: to.Ptr[int64](10),
// },
// Zones: []*string{
// to.Ptr("1"),
// },
// Name: to.Ptr("openCapacityReservation"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ComputeManagementClient } = require("@azure/arm-compute");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to the operation that retrieves information about the capacity reservation.
*
* @summary the operation that retrieves information about the capacity reservation.
* x-ms-original-file: 2026-04-01/capacityReservationExamples/OpenCapacityReservation_Get.json
*/
async function getAnOpenCapacityReservationWithInstanceView() {
const credential = new DefaultAzureCredential();
const subscriptionId = "{subscriptionId}";
const client = new ComputeManagementClient(credential, subscriptionId);
const result = await client.capacityReservations.get(
"myResourceGroup",
"openCapacityReservationGroup",
"openCapacityReservation",
{ expand: "instanceView" },
);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample response
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/openCapacityReservationGroup/capacityReservations/openCapacityReservation",
"properties": {
"platformFaultDomainCount": 3,
"reservationId": "{GUID}",
"provisioningTime": "2021-06-27T01:02:38.3138469+00:00",
"provisioningState": "Succeeded",
"instanceView": {
"utilizationInfo": {
"currentCapacity": 10,
"usedReservedCountBySubscription": {
"{subscription-id1}": 3,
"{subscription-id2}": 2
}
},
"statuses": [
{
"code": "ProvisioningState/succeeded",
"level": "Info",
"displayStatus": "Provisioning succeeded"
}
]
},
"timeCreated": "2021-06-27T01:02:38.3138469+00:00"
},
"location": "westus",
"tags": {
"{tagName}": "{tagValue}"
},
"sku": {
"name": "Standard_DS1_v2",
"capacity": 10
},
"zones": [
"1"
],
"name": "openCapacityReservation"
}
Definitions
| Name |
Description |
|
ApiError
|
Api error.
|
|
ApiErrorBase
|
Api error base.
|
|
CapacityReservation
|
Specifies information about the capacity reservation.
|
|
CapacityReservationInstanceView
|
The instance view of a capacity reservation that provides as snapshot of the runtime properties of the capacity reservation that is managed by the platform and can change outside of control plane operations.
|
|
CapacityReservationInstanceViewTypes
|
|
|
CapacityReservationStateInfo
|
Details related to the current state for a Future capacity reservation.
|
|
CapacityReservationUtilization
|
Represents the capacity reservation utilization in terms of resources allocated.
|
|
CloudError
|
An error response from the Compute service.
|
|
createdByType
|
The type of identity that created the resource.
|
|
InnerError
|
Inner error details.
|
|
InstanceViewStatus
|
Instance view status.
|
|
ReservationState
|
The current state of a Future capacity reservation.
|
|
ScheduleProfile
|
Defines the schedule for Block and Future capacity reservations. Specifies the schedule during which capacity reservation is active and VM or VMSS resource can be allocated using reservation. For Block capacity reservations, the scheduleProfile, start, and end fields are immutable after creation. Please refer to https://aka.ms/blockcapacityreservation for more details. Minimum API version for Block capacity reservations: 2025-04-01. Future capacity reservations must use this property with only a start time, which can be changed until the ‘modifiableUntil’ time. Please refer to https://aka.ms/futurecapacityreservation for more details. Minimum API version for Future capacity reservations: 2026-04-01.
|
|
Sku
|
Describes a virtual machine scale set sku. NOTE: If the new VM SKU is not supported on the hardware the scale set is currently on, you need to deallocate the VMs in the scale set before you modify the SKU name.
|
|
StatusLevelTypes
|
The level code.
|
|
SubResourceReadOnly
|
|
|
systemData
|
Metadata pertaining to creation and last modification of the resource.
|
ApiError
Object
Api error.
| Name |
Type |
Description |
|
code
|
string
|
The error code.
|
|
details
|
ApiErrorBase[]
|
The Api error details
|
|
innererror
|
InnerError
|
The Api inner error
|
|
message
|
string
|
The error message.
|
|
target
|
string
|
The target of the particular error.
|
ApiErrorBase
Object
Api error base.
| Name |
Type |
Description |
|
code
|
string
|
The error code.
|
|
message
|
string
|
The error message.
|
|
target
|
string
|
The target of the particular error.
|
CapacityReservation
Object
Specifies information about the capacity reservation.
| Name |
Type |
Description |
|
id
|
string
|
Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
|
location
|
string
|
The geo-location where the resource lives
|
|
name
|
string
|
The name of the resource
|
|
properties.instanceView
|
CapacityReservationInstanceView
|
The Capacity reservation instance view.
|
|
properties.platformFaultDomainCount
|
integer
(int32)
|
Specifies the value of fault domain count that Capacity Reservation supports for requested VM size. Note: The fault domain count specified for a resource (like virtual machines scale set) must be less than or equal to this value if it deploys using capacity reservation. Minimum api-version: 2022-08-01.
|
|
properties.provisioningState
|
string
|
The provisioning state, which only appears in the response.
|
|
properties.provisioningTime
|
string
(date-time)
|
The date time when the capacity reservation was last updated.
|
|
properties.reservationId
|
string
|
A unique id generated and assigned to the capacity reservation by the platform which does not change throughout the lifetime of the resource.
|
|
properties.scheduleProfile
|
ScheduleProfile
|
Defines the schedule for Block and Future capacity reservations. Specifies the schedule during which capacity reservation is active and VM or VMSS resource can be allocated using reservation. For Block capacity reservations, the scheduleProfile, start, and end fields are immutable after creation. Please refer to https://aka.ms/blockcapacityreservation for more details. Minimum API version for Block capacity reservations: 2025-04-01. Future capacity reservations must use this property with only a start time, which can be changed until the ‘modifiableUntil’ time. Please refer to https://aka.ms/futurecapacityreservation for more details. Minimum API version for Future capacity reservations: 2026-04-01.
|
|
properties.timeCreated
|
string
(date-time)
|
Specifies the time at which the Capacity Reservation resource was created. Minimum api-version: 2021-11-01.
|
|
properties.virtualMachinesAssociated
|
SubResourceReadOnly[]
|
A list of all virtual machine resource ids that are associated with the capacity reservation.
|
|
sku
|
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 (https://docs.microsoft.com/rest/api/compute/resourceskus/list) for supported values.
|
|
systemData
|
systemData
|
Azure Resource Manager metadata containing createdBy and modifiedBy information.
|
|
tags
|
object
|
Resource tags.
|
|
type
|
string
|
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
|
|
zones
|
string[]
|
The availability zones.
|
CapacityReservationInstanceView
Object
The instance view of a capacity reservation that provides as snapshot of the runtime properties of the capacity reservation that is managed by the platform and can change outside of control plane operations.
| Name |
Type |
Description |
|
reservationStateInfo
|
CapacityReservationStateInfo
|
The reservation state information for a capacity reservation, this detail is primarily provided for Future capacity reservations. Minimum API version: 2026-04-01.
|
|
statuses
|
InstanceViewStatus[]
|
The resource status information.
|
|
utilizationInfo
|
CapacityReservationUtilization
|
Unutilized capacity of the capacity reservation.
|
CapacityReservationInstanceViewTypes
Enumeration
| Value |
Description |
|
instanceView
|
|
CapacityReservationStateInfo
Object
Details related to the current state for a Future capacity reservation.
| Name |
Type |
Description |
|
reservationState
|
ReservationState
|
The current state of the capacity reservation.
|
CapacityReservationUtilization
Object
Represents the capacity reservation utilization in terms of resources allocated.
| Name |
Type |
Description |
|
currentCapacity
|
integer
(int32)
|
The value provides the current capacity of the VM size which was reserved successfully and for which the customer is getting billed. Minimum api-version: 2022-08-01.
|
|
usedReservedCountBySubscription
|
object
|
For open capacity reservations, this provides a map of the used reserved capacity count keyed by the subscription id (a GUID) that is consuming the capacity, i.e. each entry maps a consuming subscription id to the count of reserved capacity it is currently using. This is populated only for open capacity reservations and is not reported for targeted and block capacity reservations, which instead report allocation through virtualMachinesAllocated. Minimum api-version: 2026-04-01.
|
|
virtualMachinesAllocated
|
SubResourceReadOnly[]
|
A list of all virtual machines resource ids allocated against the capacity reservation.
|
CloudError
Object
An error response from the Compute service.
| Name |
Type |
Description |
|
error
|
ApiError
|
Api error.
|
createdByType
Enumeration
The type of identity that created the resource.
| Value |
Description |
|
User
|
|
|
Application
|
|
|
ManagedIdentity
|
|
|
Key
|
|
InnerError
Object
Inner error details.
| Name |
Type |
Description |
|
errordetail
|
string
|
The internal error message or exception dump.
|
|
exceptiontype
|
string
|
The exception type.
|
InstanceViewStatus
Object
Instance view status.
| Name |
Type |
Description |
|
code
|
string
|
The status code.
|
|
displayStatus
|
string
|
The short localizable label for the status.
|
|
level
|
StatusLevelTypes
|
The level code.
|
|
message
|
string
|
The detailed status message, including for alerts and error messages.
|
|
time
|
string
(date-time)
|
The time of the status.
|
ReservationState
Enumeration
The current state of a Future capacity reservation.
| Value |
Description |
|
Pending
|
The capacity reservation request has been submitted and is awaiting evaluation.
|
|
Declined
|
The capacity reservation request was rejected, and will not change again without user action.
|
|
Approved
|
The capacity reservation request has been approved by Azure and is awaiting fulfillment.
|
|
FulfillmentFailed
|
A failure occurred while attempting to fulfill the capacity reservation request.
|
|
Committed
|
The capacity reservation is locked and cannot be updated or deleted prior to going live.
|
|
Live
|
The capacity reservation is active and available for use, and cannot be modified or deleted until the minimum commitment period has elapsed.
|
|
PartiallyFulfilled
|
Azure was only able to deliver a portion of the requested capacity. The capacity reservation cannot be modified or deleted until the minimum commitment period has elapsed. The portion of fulfilled capacity can be viewed by inspecting the capacity reservation's instance view, displayed as currentCapacity within the utilizationInfo.
|
ScheduleProfile
Object
Defines the schedule for Block and Future capacity reservations. Specifies the schedule during which capacity reservation is active and VM or VMSS resource can be allocated using reservation. For Block capacity reservations, the scheduleProfile, start, and end fields are immutable after creation. Please refer to https://aka.ms/blockcapacityreservation for more details. Minimum API version for Block capacity reservations: 2025-04-01. Future capacity reservations must use this property with only a start time, which can be changed until the ‘modifiableUntil’ time. Please refer to https://aka.ms/futurecapacityreservation for more details. Minimum API version for Future capacity reservations: 2026-04-01.
| Name |
Type |
Description |
|
end
|
string
|
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.
|
|
minimumCommitmentDays
|
integer
(int32)
|
The minimum number of days that must pass after the start date before a Future capacity reservation can be updated or deleted once it has been committed. Will be populated with a default value if not provided.
|
|
modifiableUntil
|
string
(date-time)
|
The date/time until which a Future capacity reservation can be updated or deleted. Read-only.
|
|
start
|
string
|
The required start date for Block or Future capacity reservations. 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. Future capacity reservations: Must be at least 7 days in the future, and maximum 6 months in the future. Minimum API version for Future capacity reservations: 2026-04-01. Example: 2025-06-27, applicable for both Block and Future capacity reservations.
|
Sku
Object
Describes a virtual machine scale set sku. NOTE: If the new VM SKU is not supported on the hardware the scale set is currently on, you need to deallocate the VMs in the scale set before you modify the SKU name.
| Name |
Type |
Description |
|
capacity
|
integer
(int64)
|
Specifies the number of virtual machines in the scale set.
|
|
name
|
string
|
The sku name.
|
|
tier
|
string
|
Specifies the tier of virtual machines in a scale set.
Possible Values:
Standard
Basic
|
StatusLevelTypes
Enumeration
The level code.
| Value |
Description |
|
Info
|
|
|
Warning
|
|
|
Error
|
|
SubResourceReadOnly
Object
| Name |
Type |
Description |
|
id
|
string
|
Resource Id
|
systemData
Object
Metadata pertaining to creation and last modification of the resource.
| Name |
Type |
Description |
|
createdAt
|
string
(date-time)
|
The timestamp of resource creation (UTC).
|
|
createdBy
|
string
|
The identity that created the resource.
|
|
createdByType
|
createdByType
|
The type of identity that created the resource.
|
|
lastModifiedAt
|
string
(date-time)
|
The timestamp of resource last modification (UTC)
|
|
lastModifiedBy
|
string
|
The identity that last modified the resource.
|
|
lastModifiedByType
|
createdByType
|
The type of identity that last modified the resource.
|