summary import { NetworkConfigurationDiagnosticParameters , NetworkManagementClient } from "@msinternal/network-resource-manager" ; import { DefaultAzureCredential } from "@azure/identity" ; async function networkConfigurationDiagnostic ( ) { const subscriptionId = "subid" ; const resourceGroupName = "rg1" ; const networkWatcherName = "nw1" ; const parameters = { profiles : [ { destination : "12.11.12.14" , destinationPort : "12100" , direction : "Inbound" , source : "10.1.0.4" , protocol : "TCP" } ] , 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 . beginGetNetworkConfigurationDiagnosticAndWait ( resourceGroupName , networkWatcherName , parameters ) ; console . log ( result ) ; } networkConfigurationDiagnostic ( ) . catch ( console . error ) ;