Azure DevOps pipeline - how to deploy DB project to on-prem using custom path to SqlPackage.exe

Copper Contributor



I've been trying to figure this out for a while, but can't find my way around it. 


Our DevOps team has the SqlPackage.exe file saved in a custom location on a virtual machine used for the agents. I need to access the file to be able to deploy DB projects to on-premise server using Azure DevOps pipeline. 


I tried couple different approaches, but nothing seems to work for me. 


At the moment my deployment pipeline downloads artifacts and is able to use them for deployment, but can not actually deploy the project due to missing SqlPackage.exe file in the expected location.


Any help would be greatly appreciated! 


At the moment I'm trying to use CmdLine@2 task (see below), but it's giving me an error. 

 - taskCmdLine@2
        script'"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\sqlpackage.exe" /Action:Publish /SourceFile:"$(System.DefaultWorkingDirectory)/_WIP Build DB Symfonie2_ods/files/s/Symfonie2_ODS/bin/Debug/Symfonie2_ODS.dacpac" /TargetServerName:$(TargetServer) /TargetDatabaseName:$(TargetDatabaseName) -U $(SqlUsername) -P $(SqlPassword)/TargetEncryptConnection:False'


0 Replies