summary import { DdosCustomPolicy , NetworkManagementClient } from "@msinternal/network-resource-manager" ; import { DefaultAzureCredential } from "@azure/identity" ; async function createDDoSCustomPolicy ( ) { const subscriptionId = "subid" ; const resourceGroupName = "rg1" ; const ddosCustomPolicyName = "test-ddos-custom-policy" ; const parameters = { location : "centraluseuap" , protocolCustomSettings : [ { protocol : "Tcp" } ] } ; const credential = new DefaultAzureCredential ( ) ; const client = new NetworkManagementClient ( credential , subscriptionId ) ; const result = await client . ddosCustomPolicies . beginCreateOrUpdateAndWait ( resourceGroupName , ddosCustomPolicyName , parameters ) ; console . log ( result ) ; } createDDoSCustomPolicy ( ) . catch ( console . error ) ;