summary import { PrepareNetworkPoliciesRequest , NetworkManagementClient } from "@msinternal/network-resource-manager" ; import { DefaultAzureCredential } from "@azure/identity" ; async function prepareNetworkPolicies ( ) { const subscriptionId = "subid" ; const resourceGroupName = "rg1" ; const virtualNetworkName = "test-vnet" ; const subnetName = "subnet1" ; const prepareNetworkPoliciesRequestParameters = { serviceName : "Microsoft.Sql/managedInstances" } ; const credential = new DefaultAzureCredential ( ) ; const client = new NetworkManagementClient ( credential , subscriptionId ) ; const result = await client . subnets . beginPrepareNetworkPoliciesAndWait ( resourceGroupName , virtualNetworkName , subnetName , prepareNetworkPoliciesRequestParameters ) ; console . log ( result ) ; } prepareNetworkPolicies ( ) . catch ( console . error ) ;