0

I have a database project with some important SQL-scripts. I want to deploy and run the scripts as part of the build pipeline, because they have a tendency to fail because of human error.

I've tried to find a way to add "deployment group job" to my build pipeline, but I'm not seeing how this can be done.

I'm using Azure Devops with Git. My servers are all on-premise. I have a build and release pipeline which is working fine.

Henrik F
  • 1
  • 1

2 Answers2

0

If you want to deploy and run the SQL scripts against all your servers. You need to create a deployment group and Register all your servers in it. Then add "deployment group job" in your release pipeline.

enter image description here

Select the deployment group you created in the configuration page. You can then add script tasks(eg. powershell task) to execute your SQL scripts (The SQL scripts should be included in the build artifacts).

When you run the release pipeline, and the tasks of deployment job will run the sql scripts on all your servers registered in the deployment group.

If you just want to run the sql scripts on a single database server in your build pipeline, you can simply create a self-hosted agent on the database server machine. And run your build pipeline on the self-hosted agent. The scripts in your pipeline will be able to access to your local database server, since they are on the same machine.

Hope above helps!

Levi Lu-MSFT
  • 27,483
  • 2
  • 31
  • 43
0

Deployment group job is not supported in build pipeline, you need to do it in release pipeline.

starian chen-MSFT
  • 33,174
  • 2
  • 29
  • 53