summary import { FlowLogInformation , NetworkManagementClient } from "@msinternal/network-resource-manager" ; import { DefaultAzureCredential } from "@azure/identity" ; async function configureFlowLog ( ) { const subscriptionId = "subid" ; const resourceGroupName = "rg1" ; const networkWatcherName = "nw1" ; const parameters = { enabled : true , storageId : "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/st1" , targetResourceId : "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1" } ; const credential = new DefaultAzureCredential ( ) ; const client = new NetworkManagementClient ( credential , subscriptionId ) ; const result = await client . networkWatchers . beginSetFlowLogConfigurationAndWait ( resourceGroupName , networkWatcherName , parameters ) ; console . log ( result ) ; } configureFlowLog ( ) . catch ( console . error ) ;