summary import { MhsmPrivateEndpointConnection , KeyVaultManagementClient } from "@msinternal/keyvault-resource-manager" ; import { DefaultAzureCredential } from "@azure/identity" ; async function managedHsmPutPrivateEndpointConnection ( ) { const subscriptionId = "00000000-0000-0000-0000-000000000000" ; const resourceGroupName = "sample-group" ; const name = "sample-mhsm" ; const privateEndpointConnectionName = "sample-pec" ; const properties = { privateLinkServiceConnectionState : { description : "My name is Joe and I'm approving this." , status : "Approved" } } ; const credential = new DefaultAzureCredential ( ) ; const client = new KeyVaultManagementClient ( credential , subscriptionId ) ; const result = await client . mhsmPrivateEndpointConnections . put ( resourceGroupName , name , privateEndpointConnectionName , properties ) ; console . log ( result ) ; } managedHsmPutPrivateEndpointConnection ( ) . catch ( console . error ) ;