Hi Isaac ,
Thank you for reaching out on Microsoft Q&A forum.
Cluster looks healthy and your firewall is open, so sudden “timeout” on cosmos db for mongodb (vCore) is almost always dns or something in the outbound path (vpn/proxy/ipv6).
- check access mode
- public: you should reach the public hostname over the internet
- private endpoint: dns must return the private ip and the private dns zone must be linked to your vnet
- use the right port
- mongodb vcore listens on 27017 (tls)
- test tcp from your machine
- windows: Test-NetConnection -Port 27017
- linux/mac: nc -vz 27017
- if this fails, something on the path blocks it
- bypass srv
- try a direct string: mongodb://:@:27017/?tls=true&authSource=admin&directConnection=true
- if this works but mongodb+srv fails, it’s a dns/srv issue
- check dns
- nslookup → expect public ip (public) or private ip (private link)
- if using srv: nslookup -type=SRV _mongodb._tcp.
- if you see ipv6 (AAAA) answers, disable ipv6 or force ipv4 and retry
- flush dns cache and try again
- check tls handshake
- openssl s_client -connect :27017 -tls1_2 -servername -brief
- hang/fail usually means a proxy or tls inspection
- remove middleboxes
- disconnect vpn and proxy; try a mobile hotspot
- ensure local firewall allows outbound 27017
- recheck your current public ip if you rely on allowlists
- control test from azure
- create a small azure vm, install mongosh, connect with the same string
- works from vm but not from your place → your egress is the problem
- fails from both → likely private dns link, nsg/udr, or rare regional issue
- update client
- use the latest mongosh/driver, tls 1.2+
- set connectTimeoutMS to 10000–20000
- enable tcp keep-alive if idle sockets drop later
Refer to this resource for complete details:
- Troubleshoot common issues in Azure Cosmos DB for MongoDB vCore
- Configure an IP firewall for your Azure Cosmos DB account
- Azure Cosmos DB Data Explorer fails to connect if it still times out, please share required details in private message.