Hi Bohdan Martyniuk,
Thank you for sharing your implementation details. I wanted to clarify the current state of authentication for Azure Cosmos DB for MongoDB (RU‑based) accounts:
1.Officially Supported Authentication
For RU‑based MongoDB API accounts, the officially supported authentication method is key‑based(using the account key). Microsoft does not currently support MONGO_OIDC or Azure AD/Managed Identity authentication for RU‑based accounts.
2.About the PLAIN Mechanism You Tried
The authMechanism: 'PLAIN' approach with an Azure AD token may appear to work because the token is being treated as a password by the database. However, this is not officially supported by Microsoft, and it may not provide the same guarantees as key-based authentication. Future updates could break this behavior.
3.Recommended Approach
To ensure stability, compliance, and supportability, we recommend switching to key‑based authentication for your RU‑mode MongoDB accounts.
4.Future Support for Managed Identity / OIDC
As of now, there is no publicly available roadmap or timeline indicating that RU-based accounts will support Managed Identity / OIDC authentication.
For more information, please refer the documents:
https://free.blessedness.top/en-us/azure/cosmos-db/mongodb/vcore/entra-authentication
https://free.blessedness.top/en-us/azure/cosmos-db/mongodb/connect-account
Hope this helps. Do let us know if you any further queries.
If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.