SQL Database Project build and publish thru jenkins

Viewed 1179
  • Database - SQL Server
  • Version control - GIT/Bit bucket
  • Automation - Jenkins pipeline.

Question/task - I need to build SQL database project & deploy thru jenkins pipeline.

Currently we manually build & publish the database but I have scripts which I can use to build(dacpac) & publish to the database but problem scripts only work in VS(visual studio) command prompt.

  • Build SQL database project thru Jenkins - Is it possible, if so how?
  • Publish SQL database project thru Jenkins - Is it possible, if so how?

Please help me understand the process involved.

1 Answers

I used the DacFx API provided by Microsoft and created an API service that I integrated with jerkins. In the middle of the pipeline, I passed the SqlProject location, my target database information, and dacpac destination. The API uses Publish Method to Deploy and generate the delta and deploy it to the target database. See the link below. https://www.nuget.org/packages/Microsoft.SqlServer.DACFx

Related