Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Azure AD RBAC when using Cosmos DB #27244

Closed
MarcelMichau opened this issue Jan 21, 2022 · 2 comments
Closed

Support for Azure AD RBAC when using Cosmos DB #27244

MarcelMichau opened this issue Jan 21, 2022 · 2 comments

Comments

@MarcelMichau
Copy link

Azure Cosmos DB now supports RBAC for data plane operations using Azure AD as described here. This improves the security posture of an application as it negates the need for managing the secure storage & rotation of connection strings/account keys when communicating with Cosmos DB.

Currently, it doesn't seem like there is a way to enable Azure AD RBAC when using the Cosmos DB EF provider. This makes it impossible to connect to Azure Cosmos DB through RBAC exclusively when using EF Core. According to the Cosmos DB docs, the SDK needs to be initialized with a specific TokenCredential passed to the CosmosClient constructor, but I'm unaware of a mechanism to customize the CosmosClient used by EF other than using CosmosDbContextOptionsBuilder which does not seem to provide such an option.

It would be ideal if there was a mechanism to provide a custom CosmosClient to EF in some way. This closed issue requested something similar, though I understand the CosmosClient cannot be provided due to how EF performs caching internally. Failing that, it would be nice to have an overload of UseCosmos() which takes a TokenCredential parameter which it then passes to the SDK instead of using the AccountKey/ConnectionString.

@ajcvickers
Copy link
Member

Duplicate of #26491.

@MarcelMichau
Copy link
Author

Ah shucks, thanks @ajcvickers! I clearly missed that one, my apologies. I'll close this issue.

@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants