title: How Do I Run EF Core Migrations with VSTS Deployment to Azure for Web API Project
body: <p>My project was created via <code>dotnet new webapi --name=ProjectName</code>. 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., <code>dotnet ef database update</code></p>
  
  <p>I've reviewed several of the other Stack Overflow questions. Though helpful, none of them provided a <em>current</em> solution. References:  </p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/44755768/ef-core-migrations-in-full-net-project-in-vsts">Ef core migrations in full .net project in VSTS</a></li>
  <li><a href="https://stackoverflow.com/questions/44957938/run-ef-migration-on-vsts-release">Run EF migration on VSTS release</a></li>
  <li><a href="https://stackoverflow.com/questions/44690138/vso-ci-aspnetcore-environment-is-set-to-production-no-matter-what-i-do">VSO CI - ASPNETCORE_ENVIRONMENT is set to Production no matter what I do</a></li>
  </ul>
  
  <p>The closest I've come to being successful is adding tasks like so:</p>
  
  <ul>
  <li>Replace Tokens: Update Connection String</li>
  <li>Command Line: set ASPNETCORE_ENVIRONMENT=Production</li>
  <li>Command Line: dotnet ef database update -v</li>
  </ul>
  
  <p>This <em>almost</em> works, but for some reason ef still targets development.</p>
  
  <p>Any recent solutions?</p>