summary import { CapacityReservationGroup , ComputeManagementClient } from "@msinternal/compute-resource-manager" ; import { DefaultAzureCredential } from "@azure/identity" ; async function createOrUpdateACapacityReservationGroup ( ) { const subscriptionId = "{subscription-id}" ; const resourceGroupName = "myResourceGroup" ; const capacityReservationGroupName = "myCapacityReservationGroup" ; const parameters = { location : "westus" , tags : { department : "finance" } , zones : [ "1" , "2" ] } ; const credential = new DefaultAzureCredential ( ) ; const client = new ComputeManagementClient ( credential , subscriptionId ) ; const result = await client . capacityReservationGroups . createOrUpdate ( resourceGroupName , capacityReservationGroupName , parameters ) ; console . log ( result ) ; } createOrUpdateACapacityReservationGroup ( ) . catch ( console . error ) ;