summary import { DedicatedHostGroup , ComputeManagementClient } from "@msinternal/compute-resource-manager" ; import { DefaultAzureCredential } from "@azure/identity" ; async function createOrUpdateADedicatedHostGroup ( ) { const subscriptionId = "{subscription-id}" ; const resourceGroupName = "myResourceGroup" ; const hostGroupName = "myDedicatedHostGroup" ; const parameters = { location : "westus" , platformFaultDomainCount : 3 , supportAutomaticPlacement : true , tags : { department : "finance" } , zones : [ "1" ] } ; const credential = new DefaultAzureCredential ( ) ; const client = new ComputeManagementClient ( credential , subscriptionId ) ; const result = await client . dedicatedHostGroups . createOrUpdate ( resourceGroupName , hostGroupName , parameters ) ; console . log ( result ) ; } createOrUpdateADedicatedHostGroup ( ) . catch ( console . error ) ;