summary import { VirtualHub , NetworkManagementClient } from "@msinternal/network-resource-manager" ; import { DefaultAzureCredential } from "@azure/identity" ; async function virtualHubPut ( ) { const subscriptionId = "subid" ; const resourceGroupName = "rg1" ; const virtualHubName = "virtualHub2" ; const virtualHubParameters = { addressPrefix : "10.168.0.0/24" , location : "West US" , sku : "Basic" , tags : { key1 : "value1" } , virtualWan : { id : "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualWans/virtualWan1" } } ; const credential = new DefaultAzureCredential ( ) ; const client = new NetworkManagementClient ( credential , subscriptionId ) ; const result = await client . virtualHubs . beginCreateOrUpdateAndWait ( resourceGroupName , virtualHubName , virtualHubParameters ) ; console . log ( result ) ; } virtualHubPut ( ) . catch ( console . error ) ;