0

I have an on-premises Azure DevOps Server and have a VS2019 Solution that contains a database project (using SSDT). I have added some database unit tests to the solution and these run through correctly.

I have created a build pipeline for the database solution which builds the database project. I now want to add a task to the pipeline to execute the unit tests. The default task finds the unit tests in the solution and tries to execute them - however it is failing with the a SQL connection error 'The server was not found or was not accessible'.

The unit test project has an app.settings which has two connection strings to the same host (ExecutionContext and PrivilegedContext) - these connect using integrated security.

I have two questions:

1) How do I determine which host it is trying to connect to? or is there a variable I need to define?

2) In Azure DevOps server - how do I specify the account to run the unit tests under (so it can connect to the appropriate database server)?

Daniel Mann
  • 57,011
  • 13
  • 100
  • 120
AndyW
  • 191
  • 1
  • 11
  • 1
    What have you tried so far to fix the problem? – Daniel Mann Jan 30 '20 at 22:52
  • A bit of a fudge. After working out what the two contexts do, I have modified the app.config to point to the correct server (currently my dev machine) so 1) is resolved. However, for 2) I had to give the build server service account access to by database server which is not allowed when I move to the proper test environment. I need to run the build process or the testing process under a different domain account. – AndyW Jan 31 '20 at 01:10

0 Answers0