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
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