summary import { PrivateLinkConnectionApprovalRequestResource , WebSiteManagementClient } from "@msinternal/web-resource-manager" ; import { DefaultAzureCredential } from "@azure/identity" ; async function approvesOrRejectsAPrivateEndpointConnectionForASite ( ) { const subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345" ; const resourceGroupName = "rg" ; const name = "testSite" ; const privateEndpointConnectionName = "connection" ; const slot = "stage" ; const privateEndpointWrapper = { privateLinkServiceConnectionState : { description : "Approved by admin." , actionsRequired : "" , status : "Approved" } } ; const credential = new DefaultAzureCredential ( ) ; const client = new WebSiteManagementClient ( credential , subscriptionId ) ; const result = await client . webApps . beginApproveOrRejectPrivateEndpointConnectionSlotAndWait ( resourceGroupName , name , privateEndpointConnectionName , slot , privateEndpointWrapper ) ; console . log ( result ) ; } approvesOrRejectsAPrivateEndpointConnectionForASite ( ) . catch ( console . error ) ;