Unable to connect to my cosmos mongo db from Azure web app after enabling pvt endpoints and vnet integration

2024-06-13T06:56:16.95+00:00

I have a web app (linux) where i push my docker image via container registry which connects to the cosmos mongo database.

It works fine when eveyrthing is via public network.

When i enable private endpoints and vnet integration , my app works fine but it fails to communicate to the database.

From the same vnet, if i do nslookup from a VM to db it works indicating no issues with private endpoints

My error is:-

pymongo.errors.ServerSelectionTimeoutError:xxx.mongocluster.cosmos.azure.com:27017: [Errno -3] Temporary failure in name resolution (configured timeouts: socketTimeoutMS: 20000.0ms, connectTimeoutMS: 20000.0ms), Timeout: 30s, Topology Description: 
Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,902 questions
Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
1,173 questions
Azure | Azure Startups
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.