You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you want to use the EnsureCreated with a CosmosDB provider, the request fails with a generic 400 - BadRequest if the Cosmos instance does not have Scale setted.
To reproduce this, try to create a CosmosDB Database with Provision throughput unselected and in your code (for example in the Configure method of Startup class, try to execute the code:
dbContext.Database.EnsureCreated();
If you create the database with the Provision throughput selected and configured, the ensure works as expected.
EF Core version:
Database provider: Microsoft.EntityFrameworkCore.Cosmos v.5.0.10 and 5.0.12
Target framework: .NET 5.0
Operating system: Windows 10
IDE: Visual Studio 2019 16.11.7
The text was updated successfully, but these errors were encountered:
We might be able to throw a better exception message.
@SamueleFurnari In 6.0 we added methods on EntityTypeBuilder to configure the provisioned throughput on the associated container: HasManualThroughput and HasAutoscaleThroughput
@AndriySvyryd thank you. Currently I'm using the v.5.0.10.0 that if I understand well, does not have a way to manage the autoscale throughput.
If I want to maintains the actual EF version, the only way to be sure that EnsureCreated works, is to be sure that the database has the throughput set. Is this correct?
If you want to use the EnsureCreated with a CosmosDB provider, the request fails with a generic 400 - BadRequest if the Cosmos instance does not have Scale setted.
To reproduce this, try to create a CosmosDB Database with Provision throughput unselected and in your code (for example in the Configure method of Startup class, try to execute the code:
If you create the database with the Provision throughput selected and configured, the ensure works as expected.
EF Core version:
Database provider: Microsoft.EntityFrameworkCore.Cosmos v.5.0.10 and 5.0.12
Target framework: .NET 5.0
Operating system: Windows 10
IDE: Visual Studio 2019 16.11.7
The text was updated successfully, but these errors were encountered: