summary import { NetworkManagementClient } from "@msinternal/network-resource-manager" ; import { DefaultAzureCredential } from "@azure/identity" ; async function deleteSubnet ( ) { const subscriptionId = "subid" ; const resourceGroupName = "subnet-test" ; const virtualNetworkName = "vnetname" ; const subnetName = "subnet1" ; const credential = new DefaultAzureCredential ( ) ; const client = new NetworkManagementClient ( credential , subscriptionId ) ; const result = await client . subnets . beginDeleteAndWait ( resourceGroupName , virtualNetworkName , subnetName ) ; console . log ( result ) ; } deleteSubnet ( ) . catch ( console . error ) ;