Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Configure Azure SQL DTU with Entity Framework Code First

I would like to know if it is possible to define the DTU of a Azure SQL database when using Entity Framework Code First? What i mean is, you can use DropCreateDatabaseIfModelChanges-DropCreateDatabaseAlways, but each time it is dropped and re created, it gets the Standard DTU by default but it needs to be the Basic DTU.

This is what i mean: enter image description here

Any way of achieving this either with entity framework configuration or another approach? Thank you in advance for any feedback! Kind regards

like image 695
Dimitri Avatar asked Jan 30 '26 08:01

Dimitri


1 Answers

You can create an Azure Sql database programmatically in C#. You can add almost everything from recourse grup, server, database. There is different way that you can do it but I have used the code from this sample from Microsoft OneCode team. Is not the code that can complete all your task but is a god starting point to achieve it.

like image 139
Llazar Avatar answered Jan 31 '26 21:01

Llazar