summary import { DedicatedHost , ComputeManagementClient } from "@msinternal/compute-resource-manager" ; import { DefaultAzureCredential } from "@azure/identity" ; async function createOrUpdateADedicatedHost ( ) { const subscriptionId = "{subscription-id}" ; const resourceGroupName = "myResourceGroup" ; const hostGroupName = "myDedicatedHostGroup" ; const hostName = "myDedicatedHost" ; const parameters = { location : "westus" , platformFaultDomain : 1 , sku : { name : "DSv3-Type1" } , tags : { department : "HR" } } ; const credential = new DefaultAzureCredential ( ) ; const client = new ComputeManagementClient ( credential , subscriptionId ) ; const result = await client . dedicatedHosts . beginCreateOrUpdateAndWait ( resourceGroupName , hostGroupName , hostName , parameters ) ; console . log ( result ) ; } createOrUpdateADedicatedHost ( ) . catch ( console . error ) ;