We are using DbUp migration task (https://marketplace.visualstudio.com/items?itemName=johanclasson.UpdateDatabaseWithDbUp) for deploying the SQL scripts to Microsoft SQL server in Azure DevOps and this works perfectly fine when I need to deploy to a single database but could someone please help me how can I use this task for multiple databases in the same server or any other methods we can use for multiple databases.
Asked
Active
Viewed 518 times
0
-
Do you have a limited number of databases? Can you add separate DbUp task for each of them -- and have the scripts in different directories? – James Z Feb 01 '22 at 15:08
-
No we have more than 20 databases and it keeps expanding – DevOps Beginner Feb 01 '22 at 15:37
1 Answers
0
It all depends how you have your scripts organized. However, assuming that you have scripts separated by database - each database has it's own folder than what yout need is just provider proper value for Script Folder Path
and proper connection string with database. In this case it will endup in having one task per database.

Krzysztof Madej
- 32,704
- 10
- 78
- 107
-
For the dbUp.database variable we can add only one database in the release pipelines which will be used by all the tasks added in the pipeline – DevOps Beginner Feb 01 '22 at 11:55
-
You need variable per database, or split database across many stages than you can have the same variable with different value for each stage. – Krzysztof Madej Feb 01 '22 at 11:57
-
we cannot have multiple values for dbup.database variable which is associated with the dbup migration task, please find the screenshot attached in the question – DevOps Beginner Feb 01 '22 at 14:03