Migrations and configuration. Not started when deploying Azure

I am on EF, with standard code first DbContext.

public class MyContext : DbContext {}

      

My seed method in Configuration.cs runs fine locally when I do "Update-Database"

But when I deploy an Azure Web App instance, none of my seed data appears. My initial migration is running, but when I add a new migration and publish it, it won't start. So basically only my initial migration appears and there is no seed data.

Azure web publish dialogue

If I check "Update Database" the publication just hangs indefinitely.

I read that there should be a checkbox for "Perform first steps of code migration", but I don't seem to have that checkbox. I have tried cleaning my project and restarting VS2013update4. Project recovery, etc. Nothing shows it. I've also tried this: http://www.dominicstpierre.com/2012/11/enable-code-first-migrations-check-box.html but it doesn't seem to work with VS2013u4.

The migrations are in my project MyProject.DataLayer. The actual web app is at MyProject.WebApp. Will it be? It works fine locally.

What can I do to show this checkbox?

+3


source to share


1 answer


Entity Framework installs initializer on target machine web.config

This initializer is run when your application first enters the database.



Here's a link to a good article on asp.net that explains how to achieve this: http://www.asp.net/mvc/overview/getting-started/getting-started-with-ef-using-mvc/migrations- and-deployment-with-the-entity-framework-in-an-asp-net-mvc-application

0


source







All Articles