On-premise deployments with Azure DevOps – Database Migrations

  • Szilard David

  • May 7, 2020

  • Blog
  • 4 min read

This is the third post on this topic. The entire series consists of these posts:


This description uses DbUp as the tool for deploying migrations. For a detailed description check out Database migrations with DbUp.

This post will cover how the migration process can be implemented inside a task group, which can be used across multiple stages inside a multi-environment release.

Task Group

1. The first task group creates a backup of the project. See Part 2 of this series for details

2. The second task copies the project files from the build artifact into the applications folder.

3. The third task replaces the connection string and environment name with release variables (ConnectionString and EnvironmentName are the variables).

This is done using the Magic Chunks extension that can be installed into DevOps.

4. The fourth task is the one that actually executes the migrations using Powershell.

Replace Migrations.exe with the executable name from your migrations project (for example if you have been using the sample project described in the post mentioned above, the executable would be DbUpTutorial.exe)


You might also be interested in:

  • Szilard David

  • May 6, 2020

  • 8 min read

  • Blog

Database migrations with DbUp

Database migrations are a way to maintain the database schema and data changes in a database in a repeatable, automated ...