Overview:
I am working on ASP.NET MVC Project with Entity Framework's Code First approach for the database.
I recently automated the deployment process via VSO pipelines (Build & Release)
Problem:
- For Application Deployment it's perfect and working fine.
- For Database I am facing issues (explained below).
Details:
I read this, this and this but issues in these solutions are
They are using Publish Profile setting, which would run the migration on application start event, which I don't want (not a best practice though)
For others using Build Pipeline (copying (a) EF tools, (b) Dll's and (c) run migrate.exe via command line to run update-database command), and it will eventually run migrations on Successful Build. I rather want it to deploy changes on 'Successful Release'.
My Work
I moved step (c) from build to release pipeline. But it's not able to find the drop.
Secondly, How to roll back in case of a crash on production?
Can anyone suggest what the best approach to solving this scenario?