summary import { FlowLog , NetworkManagementClient } from "@msinternal/network-resource-manager" ; import { DefaultAzureCredential } from "@azure/identity" ; async function createOrUpdateFlowLog ( ) { const subscriptionId = "subid" ; const resourceGroupName = "rg1" ; const networkWatcherName = "nw1" ; const flowLogName = "fl" ; const parameters = { format : { type : "JSON" , version : 1 } , enabled : true , location : "centraluseuap" , storageId : "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/nwtest1mgvbfmqsigdxe" , targetResourceId : "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/desmondcentral-nsg" } ; const credential = new DefaultAzureCredential ( ) ; const client = new NetworkManagementClient ( credential , subscriptionId ) ; const result = await client . flowLogs . beginCreateOrUpdateAndWait ( resourceGroupName , networkWatcherName , flowLogName , parameters ) ; console . log ( result ) ; } createOrUpdateFlowLog ( ) . catch ( console . error ) ;