How to export a BACPAC from SQL after failing unit tests.

eric's Avatar


16 May, 2018 11:30 PM

I've got a unit test that is failing for reasons I cannot figure out. Only in my AppVeyor builds, not locally. I'd like to inspect the SQL state after the unit tests are complete, so I'd like to export a BACPAC as a build artifact after is is done, if the build fails.

  1. Support Staff 1 Posted by Owen McDonnell on 17 May, 2018 01:12 AM

    Owen McDonnell's Avatar

    Can you link us to the build or provide yaml configuration and/or build log?

  2. Support Staff 2 Posted by Ilya Finkelshte... on 17 May, 2018 04:22 AM

    Ilya Finkelshteyn's Avatar

    @eric you can use SqlPackage.exe from any of those folders:

    • C:\Program Files (x86)\Microsoft SQL Server\110\DAC\bin
    • C:\Program Files (x86)\Microsoft SQL Server\120\DAC\bin
    • C:\Program Files (x86)\Microsoft SQL Server\140\DAC\bin

    But I think that more productive would be to RDP to build VM and debug tests manually. Note however that environment variables from build session are not available in RDP session so you need to re-create some of them manually (if your tests depend on them).

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac