UseCosmos with managed identity is not working correct #33328
Labels
area-cosmos
customer-reported
punted-for-9.0
Originally planned for the EF Core 9.0 (EF9) release, but moved out due to resource constraints.
type-bug
Milestone
We normally using managed identities to access cosmos db with ef core.
The error occurs in an azure function app running on an appservice(P2v3). We have a servicebus batch trigger, which is inserting data. After a while the attached exception occurs and can be only fixed with a function restart.
I isolated the error to the managed identity access, cause when i change the authentication to connection string, it is working. For a moment we can use the connection string, but we want to change back to managed identity.
I create a simple app and i can reproduced it to, so i will insert just the service registration.
We inject the CosmosDbContext in a scoped service.
The registration which create the exception:
The registration which not create the exception:
stack traces
Include provider and version information
EF Core version: 8.0.2
Database provider: Microsoft.EntityFrameworkCore.Cosmos
Target framework: NET 8.*)
The text was updated successfully, but these errors were encountered: