summary import { BastionHost , NetworkManagementClient } from "@msinternal/network-resource-manager" ; import { DefaultAzureCredential } from "@azure/identity" ; async function createBastionHost ( ) { const subscriptionId = "subid" ; const resourceGroupName = "rg1" ; const bastionHostName = "bastionhosttenant" ; const parameters = { ipConfigurations : [ { name : "bastionHostIpConfiguration" , publicIPAddress : { id : "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pipName" } , subnet : { id : "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2/subnets/BastionHostSubnet" } } ] } ; const credential = new DefaultAzureCredential ( ) ; const client = new NetworkManagementClient ( credential , subscriptionId ) ; const result = await client . bastionHosts . beginCreateOrUpdateAndWait ( resourceGroupName , bastionHostName , parameters ) ; console . log ( result ) ; } createBastionHost ( ) . catch ( console . error ) ;