summary import { CapacityReservation , ComputeManagementClient } from "@msinternal/compute-resource-manager" ; import { DefaultAzureCredential } from "@azure/identity" ; async function createOrUpdateACapacityReservation ( ) { const subscriptionId = "{subscription-id}" ; const resourceGroupName = "myResourceGroup" ; const capacityReservationGroupName = "myCapacityReservationGroup" ; const capacityReservationName = "myCapacityReservation" ; const parameters = { location : "westus" , sku : { name : "Standard_DS1_v2" , capacity : 4 } , tags : { department : "HR" } , zones : [ "1" ] } ; const credential = new DefaultAzureCredential ( ) ; const client = new ComputeManagementClient ( credential , subscriptionId ) ; const result = await client . capacityReservations . beginCreateOrUpdateAndWait ( resourceGroupName , capacityReservationGroupName , capacityReservationName , parameters ) ; console . log ( result ) ; } createOrUpdateACapacityReservation ( ) . catch ( console . error ) ;