How to automatically start the first code migrations to the database when using WebDeploy to publish a web application

I am trying to set up an automatic SQL database update using First First Migrations when I publish my web application for Azure.

So far, I have a publishing profile that copies the application to a remote Azure server, but the database is not updated when the application is published. If I run the "Update Database" command directly from the package manager console, it updates the remote database, but it does not work if I use the profile. I read the tutorial step by step from Microsoft, which dates back to 2014, and I propose to enable the "Use the first migration steps" function in the publication profile, but this is not an option in Visual Studio Community 2015, and the first steps of code migration are already configured in my application .

Any idea on how to run First First Migrations when publishing my application through web deployment?

Thanks in advance.

+5
source share
1 answer

In this article, you will go step by step on how to do this.

His is an older article, but the same concepts and instructions still apply.

https://blogs.msdn.microsoft.com/webdev/2014/04/08/ef-code-first-migrations-deployment-to-an-azure-cloud-service/

0
source

Source: https://habr.com/ru/post/1246734/