summary import { NetworkManagementClient } from "@msinternal/network-resource-manager" ; import { DefaultAzureCredential } from "@azure/identity" ; async function virtualNetworkGatewaysListConnections ( ) { const subscriptionId = "subid" ; const resourceGroupName = "testrg" ; const virtualNetworkGatewayName = "test-vpn-gateway-1" ; const credential = new DefaultAzureCredential ( ) ; const client = new NetworkManagementClient ( credential , subscriptionId ) ; const resArray = new Array ( ) ; for await ( let item of client . virtualNetworkGateways . listConnections ( resourceGroupName , virtualNetworkGatewayName ) ) { resArray . push ( item ) ; } console . log ( resArray ) ; } virtualNetworkGatewaysListConnections ( ) . catch ( console . error ) ;