3

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

4
  • 1
    Check this link code.msdn.microsoft.com/How-to-create-an-Azure-SQL-dbd0bf6a/… Commented Nov 26, 2018 at 9:31
  • Will check and test this out, looks interesting, i will see if i can combine this along using Entity Framework. Will post an update this week. (Thank you so far!) Commented Nov 26, 2018 at 10:21
  • Hi @Llazar, this seems to be what i need but i can't make it work, issues with the "clientId" that is not found, i will try later on to register the App (i tried with a registered app but this didn't work neither ...). Thank you, you can post this as answer if you like so i can mark it as one ;) Commented Nov 27, 2018 at 10:51
  • With clientId they used to authenticate with AAD but you don't include it your solution if doesn't needed. Commented Nov 27, 2018 at 13:17

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you again, very useful!
Glad that solution helpt you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.