1

We have implemented DevOps for our, SQLServer based, database releases on Azure DevOps using MSBuild (to create the dacpac in the build pipeline) and sqlpackage.exe (for deploying the dacpacs).

The build pipeline results in two dacpacs (one for DatabaseOne and the other for DatabaseTwo) and we use sqlpackage to release the dacpacs.

We are facing a scenario where in a single change set

a. In DatabaseOne there is a change to a stored procedure, which references a new table in DatabaseTwo

b. We are creating the new table in DatabaseTwo

There is an error when deploying the changes because sequentially, DatabaseOne is deployed before DatabaseTwo. The deployment succeeds upon retry but we are looking for a solution that works in general.

Has anyone come across such an need?

Dale K
  • 25,246
  • 15
  • 42
  • 71
Gopinath Rajee
  • 400
  • 5
  • 20
  • Can you deploy database2 before database1? – Lajos Arpad Jan 29 '19 at 02:17
  • Manually yes. Only if I know that there is such a dependency in advance from the developers. But the deployment pipeline (Build & Release) is automated. With in a dacpac package, SQLPackage handles such dependencies gracefully but not when dependencies span dacpacs. – Gopinath Rajee Jan 29 '19 at 02:30

0 Answers0