I am trying to create an ASP.NET MVC site loosely based on this tutorial. http://www.windowsazure.com/en-us/develop/net/tutorials/web-site-with-sql-database/
I am using VS2013 preview which gave me the option to create an ASP.NET MVC 5 site. Also, using the following packages:
After configuring a website and associating it with a database in Azure, I proceeded to run the following commands in the package manager console:
enable-migrations -ContextTypeName IdentityDbContext
When I published to Azure with the database specified and the "Execute Code First Migrations" checkbox checked, the site deployed properly, but after inspecting my DB, the migrations didn't run. My migrations had been successful previously on a site with ASP.Net MVC 4 and EF 5.0.
I would guess the problem is that EF 6 is ignoring the connection string that is set during publishing, but I cannot understand why.
Any help would be appreciated. Thank you.
The key part being "Execute Code First Migrations (runs on application start)"
I hope that helps.
This question is already marked as answered but while I was looking for information for my own deployment on Azure, I found this blog extremely helpful. Then I'd like to share because it concisely covers all the possible scenarios for your deployments using Code First Migrations.
Hope that helps for new searchers.