summary import { NetworkManagementClient } from "@msinternal/network-resource-manager" ; import { DefaultAzureCredential } from "@azure/identity" ; async function getVmssPublicIP ( ) { const subscriptionId = "subid" ; const resourceGroupName = "vmss-tester" ; const virtualMachineScaleSetName = "vmss1" ; const virtualmachineIndex = "1" ; const networkInterfaceName = "nic1" ; const ipConfigurationName = "ip1" ; const publicIpAddressName = "pub1" ; const credential = new DefaultAzureCredential ( ) ; const client = new NetworkManagementClient ( credential , subscriptionId ) ; const result = await client . publicIPAddresses . getVirtualMachineScaleSetPublicIPAddress ( resourceGroupName , virtualMachineScaleSetName , virtualmachineIndex , networkInterfaceName , ipConfigurationName , publicIpAddressName ) ; console . log ( result ) ; } getVmssPublicIP ( ) . catch ( console . error ) ;