Hi Bharath •,
Welcome to Microsoft Q&A forum and thanks for using Azure Services.
As I understand, you are unable to connect local node.js with CosmosDb having public access and private link enabled.
We are sorry about the inconvenience you are facing.
The following limitations apply when you use Private Link with an Azure Cosmos DB account, please check if your account meets below criteria:
You can't have more than 200 private endpoints on a single Azure Cosmos DB account.
- When you use Private Link with an Azure Cosmos DB account through a direct mode connection, you can use only the TCP protocol. The HTTP protocol isn't currently supported.
- When you use Azure Cosmos DB's API for a MongoDB account, a private endpoint is supported for accounts on server version 3.6 or higher (that is, accounts using the endpoint in the format
*.mongo.cosmos.azure.com
). Private Link isn't supported for accounts on server version 3.2 (that is, accounts using the endpoint in the format*.documents.azure.com
). To use Private Link, you should migrate old accounts to the new version.
When you use Azure Cosmos DB's API for a MongoDB account that has a Private Link, tools and libraries must support Service Name Identification (SNI) or pass the appName
parameter from the connection string to properly connect. Some older tools and libraries might not be compatible with the Private Link feature.
A network administrator should be granted at least the Microsoft.DocumentDB/databaseAccounts/PrivateEndpointConnectionsApproval/action
permission at the Azure Cosmos DB account scope to create automatically approved private endpoints.
- Currently, you can't approve a rejected private endpoint connection. Instead, re-create the private endpoint to resume the private connectivity. The Azure Cosmos DB private link service automatically approves the re-created private endpoint.
Reference link: https://learn.microsoft.com/en-us/azure/cosmos-db/how-to-configure-private-endpoints
Let us know the result so that we can look into this further if account is fine.
Thanks