Search code examples
.netentity-framework-4azureef-code-firstazure-sql-database

What Determines SQL Azure Database Edition and Size with EF Code First?


I have a POC solution that uses an ASP.NET MVC 3 to create a web site and Entity Framework 4.3 Code First approach for the data access. I am able to deploy to a hosted service in Azure and my database gets created in SQL Azure based on my connection string. What I don't understand is how the database edition (Web) and size (1GB) were determined. Is this just the default or is it controllable?

I may plan to approach this by setting my database initializer to null when going to production and manage that on my own anyway, but I want to understand the options. Thanks


Solution

  • You can specify edition and max size in the CREATE DATABASE call. If the edition and maxsize parameters are omitted, the default is Web, 1GB. The full CREATE DATABASE call is:

    CREATE DATABASE database_name  [ COLLATE collation_name ]
    {
       (<edition_options> [, ...n]) 
    }
    
    <edition_options> ::= 
    {
       (MAXSIZE = {1 | 5 | 10 | 20 | 30 … 150} GB) 
        |(EDITION = {'web' | 'business'})
    }
    

    See this MSDN reference page for more details.