summary import { PrivateEndpoint , NetworkManagementClient } from "@msinternal/network-resource-manager" ; import { DefaultAzureCredential } from "@azure/identity" ; async function createPrivateEndpointWithApplicationSecurityGroups ( ) { const subscriptionId = "subId" ; const resourceGroupName = "rg1" ; const privateEndpointName = "testPe" ; const parameters = { applicationSecurityGroups : [ { id : "/subscriptions/subId/resourceGroups/rg1/provders/Microsoft.Network/applicationSecurityGroup/asg1" } ] , location : "eastus2euap" , privateLinkServiceConnections : [ { groupIds : [ "groupIdFromResource" ] , privateLinkServiceId : "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateLinkServices/testPls" , requestMessage : "Please approve my connection." } ] , subnet : { id : "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet" } } ; const credential = new DefaultAzureCredential ( ) ; const client = new NetworkManagementClient ( credential , subscriptionId ) ; const result = await client . privateEndpoints . beginCreateOrUpdateAndWait ( resourceGroupName , privateEndpointName , parameters ) ; console . log ( result ) ; } createPrivateEndpointWithApplicationSecurityGroups ( ) . catch ( console . error ) ;