Hi Harikant Kumar,
Thank you for reaching out to Microsoft QA! Thank you for confirming your setup and for following the official documentation.
The issue you are experiencing is due to a limitation in the current versions of mongosh and MongoDB Compass they do not yet support Microsoft Entra ID (OIDC) authentication for Azure Cosmos DB for MongoDB vCore endpoints. The error about the host not being valid for OIDC authentication, and the lack of a browser prompt in Compass, are both caused by missing support in these tools for Cosmos DB’s specific OIDC flow and hostname.
At this time, the only officially supported way to connect with Microsoft Entra ID is through application code using supported SDKs (like .NET, Node.js, or Python) that use Azure identity libraries and can correctly acquire and pass OIDC tokens to Cosmos DB. Neither mongosh nor Compass currently has the capability to complete the required OIDC authentication with Cosmos DB for MongoDB vCore.
There is no workaround available in the shell or in Compass until developers add this support in a future update. This limitation is documented and known by both Microsoft and the MongoDB community.
Helpful References:
- https://learn.microsoft.com/en-us/azure/documentdb/troubleshoot-common-issues
- https://learn.microsoft.com/en-us/azure/documentdb/how-to-connect-role-based-access-control?pivots=rest-api
Hope this helps. Do let us know if you have any further queries.