How to create a sql azure database with entity framework codefirst How to create a sql azure database with entity framework codefirst

How to create a Sql Azure database with Entity Framework codefirst

'King Cloud' photo (c) 2007, Karen Ka Ying Wong - license: http://creativecommons.org/licenses/by-sa/2.0/I’ve lately begun to use Windows Azure, and I thought I would start blogging about it as well.

Sql Azure database with entity framework codefirst – the song remains the same

As I am deeply committed to using ASP.net MVC 3 with Entity Framework CodeFirst, I thought at first moving to Azure might be a problem, as Sql Azure is marketed as a cousin to Sql Server, and not the real thing.  Happily that seems not to be the case.

I searched for a guide on how to use Entity Framework Codefirst with Sql Azure and couldn’t find one – so I just up and tried it and it worked quite well.  It works just like the regular Codefirst method, only you must specify the proper sql azure database in the web.Debug.config and the web.Release.config files.  Furthermore, that database must not already exist.  The Windows Azure admin screens strongly guide you in the direction of creating an initial database, but I’ve found if you just delete your default database it will create one for you.

So, in sum, you just treat Sql Azure the same as you would any other Sql Server database.  I’m not sure why Microsoft is marketing it as something radically different, but so far I have not discovered any meaningful differences between the two systems.

Tags:

 

Written By Steve French

 

3 responses to “How to create a Sql Azure database with Entity Framework codefirst”

  1. SQL Azure is running as a Service and pays you as you go, but SQL Server as a product you need to pay it at once.. Technically, there are many limitations on SQL Azure, but getting better.

Leave a Reply

Your email address will not be published. Required fields are marked *






Copyright 2011 Digital Tool Factory. All Rights Reserved. Powered by raw technical talent. And in this case, WordPress.