summary import { NetworkManagementClient } from "@msinternal/network-resource-manager" ; import { DefaultAzureCredential } from "@azure/identity" ; async function listVmssPublicIP ( ) { const subscriptionId = "subid" ; const resourceGroupName = "vmss-tester" ; const virtualMachineScaleSetName = "vmss1" ; const credential = new DefaultAzureCredential ( ) ; const client = new NetworkManagementClient ( credential , subscriptionId ) ; const resArray = new Array ( ) ; for await ( let item of client . publicIPAddresses . listVirtualMachineScaleSetPublicIPAddresses ( resourceGroupName , virtualMachineScaleSetName ) ) { resArray . push ( item ) ; } console . log ( resArray ) ; } listVmssPublicIP ( ) . catch ( console . error ) ;