We are using TFS 2015 Release Management to deploy updates to various environments, and one of the release steps is to use the "SQL Server Database Deployment" task, with a Publish Profile, to apply a DACPAC to the target SQL Server 2012 database for the environment.
In each of our environments we have a mirrored pair of database servers, with one "primary", and the other "mirror", at any one time.
The GUI within Visual Studio for managing the Publish Profiles doesn't seem to provide for "failover partner", so I manually edited the XML file for the Publish Profile to add the "failover partner" element to the connection string.
However, it seems that the Publish Profile approach does not support mirrored database connection strings, so when our database is Primary on the node identified as the "failover partner" in the connection string, the DACPAC deployment (which uses sqlpackage.exe) fails with the error: "Cannot open database "DatabaseName" requested by the login". We have worked out that it is ignoring the "failover partner" and is simply trying to connect to the non-active node.
I have also tried running the deploy from within Visual Studio 2015, using the Publish Profile, and the same error occurred when the database was on the node identified as the failover partner.
So my question is, how can we use a DACPAC with a Publish Profile and sqlpackage.exe to update the appropriate database at deploy-time, where the database may be primary on either of the nodes in a mirrored pair?
