summary import { NextHopParameters , NetworkManagementClient } from "@msinternal/network-resource-manager" ; import { DefaultAzureCredential } from "@azure/identity" ; async function getNextHop ( ) { const subscriptionId = "subid" ; const resourceGroupName = "rg1" ; const networkWatcherName = "nw1" ; const parameters = { destinationIPAddress : "10.0.0.10" , sourceIPAddress : "10.0.0.5" , targetNicResourceId : "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/nic1" , targetResourceId : "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1" } ; const credential = new DefaultAzureCredential ( ) ; const client = new NetworkManagementClient ( credential , subscriptionId ) ; const result = await client . networkWatchers . beginGetNextHopAndWait ( resourceGroupName , networkWatcherName , parameters ) ; console . log ( result ) ; } getNextHop ( ) . catch ( console . error ) ;