summary import { NetworkManagementClient } from "@msinternal/network-resource-manager" ; import { DefaultAzureCredential } from "@azure/identity" ; async function deleteServiceEndpointPolicyDefinitionsFromServiceEndpointPolicy ( ) { const subscriptionId = "subid" ; const resourceGroupName = "rg1" ; const serviceEndpointPolicyName = "testPolicy" ; const serviceEndpointPolicyDefinitionName = "testDefinition" ; const credential = new DefaultAzureCredential ( ) ; const client = new NetworkManagementClient ( credential , subscriptionId ) ; const result = await client . serviceEndpointPolicyDefinitions . beginDeleteAndWait ( resourceGroupName , serviceEndpointPolicyName , serviceEndpointPolicyDefinitionName ) ; console . log ( result ) ; } deleteServiceEndpointPolicyDefinitionsFromServiceEndpointPolicy ( ) . catch ( console . error ) ;