summary import { NetworkManagementClient } from "@msinternal/network-resource-manager" ; import { DefaultAzureCredential } from "@azure/identity" ; async function queryConnectionMonitor ( ) { const subscriptionId = "subid" ; const resourceGroupName = "rg1" ; const networkWatcherName = "nw1" ; const connectionMonitorName = "cm1" ; const credential = new DefaultAzureCredential ( ) ; const client = new NetworkManagementClient ( credential , subscriptionId ) ; const result = await client . connectionMonitors . beginQueryAndWait ( resourceGroupName , networkWatcherName , connectionMonitorName ) ; console . log ( result ) ; } queryConnectionMonitor ( ) . catch ( console . error ) ;