summary import { Subnet , NetworkManagementClient } from "@msinternal/network-resource-manager" ; import { DefaultAzureCredential } from "@azure/identity" ; async function createSubnetWithADelegation ( ) { const subscriptionId = "subId" ; const resourceGroupName = "subnet-test" ; const virtualNetworkName = "vnetname" ; const subnetName = "subnet1" ; const subnetParameters = { addressPrefix : "10.0.0.0/16" } ; const credential = new DefaultAzureCredential ( ) ; const client = new NetworkManagementClient ( credential , subscriptionId ) ; const result = await client . subnets . beginCreateOrUpdateAndWait ( resourceGroupName , virtualNetworkName , subnetName , subnetParameters ) ; console . log ( result ) ; } createSubnetWithADelegation ( ) . catch ( console . error ) ;