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,520 questions
Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
833 questions
Azure Startups
Azure Startups
Azure: A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.Startups: Companies that are in their initial stages of business and typically developing a business model and seeking financing.
236 questions
{count} votes