My project was created via dotnet new webapi --name=ProjectName
. I've setup a build definition in VSTS. The Deployment to Azure runs fine, but I can't figure out how to run my migrations, i.e., dotnet ef database update
I've reviewed several of the other Stack Overflow questions. Though helpful, none of them provided a current solution. References:
- Ef core migrations in full .net project in VSTS
- Run EF migration on VSTS release
- VSO CI - ASPNETCORE_ENVIRONMENT is set to Production no matter what I do
The closest I've come to being successful is adding tasks like so:
- Replace Tokens: Update Connection String
- Command Line: set ASPNETCORE_ENVIRONMENT=Production
- Command Line: dotnet ef database update -v
This almost works, but for some reason ef still targets development.
Any recent solutions?