Search code examples
azure-devopsazure-pipelinessqlpackage

Azure agent: where to find SqlPackage.exe


I use a Microsoft hosted agent for building and verifying my project including an sql project.

On this azure agent I need to find the SqlPackage.exe file to call it via a powershell task. I know that there is the SqlServerDacpacDeployment task but that does not satisfy my needs. I also know that the SqlPackage.exe has to be somewhere because the SqlServerDacpacDeployment task can run without the failure that it can not find the SqlPackage.exe file.

Does anybody know where it is installed on an agent with vmImage: 'VS2017-Win2016' or how to located it?


Solution

  • For VS2017-Win2016 agent:

    You can find the SqlPackage.exe under path C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\150\

    This is also the installation path in local machine. For devops, you can use CMD task with content below to check whether the SqlPackage.exe exists there:

    C:
    cd C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\150\
    dir
    

    Check the log and you'll find:

    enter image description here

    And for Windows-2019, just use 2019 instead of 2017 in the path above.