-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Can't connect with Managed Identity and Cosmos provider #34317
Comments
Are you able to query using the Cosmos SDK directly? Not related, but you should move out the credential instance when configuring the context: var credential = new DefaultAzureCredential();
services.AddDbContext<EFSNoSqlDbContext>(options => options.UseCosmos(
cosmosConfigs.AccountEndpoint, credential, cosmosConfigs.DatabaseName)); |
Honestly I have never used the Cosmos SDK directly, however with your suggestion the issue has not been solved. |
What was the result of using it directly? Did it work? |
@AndriySvyryd
we essentially register DB context, register repositories and ensure the creation of the DB
The problem was that the built-in role |
Right. Also, Cosmos SDK (used by EF) can't perform configuration operations using RBAC, you'd have to perform them using the ARM SDK or via portal. |
Ask a question
I've followed these docs
Authenticate .NET apps to Azure services during local development using developer accounts
Use system-assigned managed identities to access Azure Cosmos DB data
Inspected #26573, #26491 and #26491
Steps done
1 - Added the Cosmos DB Built-in Data Contributor to my identity for local debuging and to Azure resource with the following PS script
2 - Execute my example Console APP using the following DI registration
3 - Execute a simple query command
Stack trace
Version
EF Core version: 8.0.7
Database provider: CosmosDB
Target framework: .NET 8.0)
Operating system:
The text was updated successfully, but these errors were encountered: