summary import { BastionShareableLinkListRequest , NetworkManagementClient } from "@msinternal/network-resource-manager" ; import { DefaultAzureCredential } from "@azure/identity" ; async function returnsTheBastionShareableLinksForTheRequestVMS ( ) { const subscriptionId = "subid" ; const resourceGroupName = "rg1" ; const bastionHostName = "bastionhosttenant" ; const bslRequest = { vms : [ { vm : { id : "/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm1" } } , { vm : { id : "/subscriptions/subid/resourceGroups/rgx/providers/Microsoft.Compute/virtualMachines/vm2" } } ] } ; const credential = new DefaultAzureCredential ( ) ; const client = new NetworkManagementClient ( credential , subscriptionId ) ; const resArray = new Array ( ) ; for await ( let item of client . listBastionShareableLink ( resourceGroupName , bastionHostName , bslRequest ) ) { resArray . push ( item ) ; } console . log ( resArray ) ; } returnsTheBastionShareableLinksForTheRequestVMS ( ) . catch ( console . error ) ;