SqlAzureDacpacDeployment fails on Hosted Windows 2019 agent
See original GitHub issueRequired Information
Question, Bug, or Feature?
Type: Bug
Enter Task Name: SqlAzureDacpacDeployment
Environment
- Server - Azure Pipelines
- Agent - Hosted:
- If using Hosted agent, provide agent queue name: Hosted Windows 2019 with VS2019
Issue Description
Looks like a bug was introduced in one of the recent versions of sqlpackage.exe Publish is working on our private agents with the older version of sqlpackage but fails on most recent hosted Windows 2019. With the more recent version the publish command it still gets some bits from connection string specified in publish profile.
Here is the command line from SqlAzureDacpacDeployment task:
C:\Program Files\Microsoft SQL Server\150\DAC\bin\SqlPackage.exe" /Action:Publish /SourceFile:"d:\Database.dacpac" /TargetServerName:"*****" /TargetDatabaseName:"*****" /TargetUser:"***" /TargetPassword:"********" /Profile:"d:\Database.publish.xml" /p:AllowIncompatiblePlatform=true
It was working when the sqlpackage.exe was coming from the folder: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\140\SqlPackage.exe
Error I am getting:
Could not deploy package.
Unable to connect to target server '*****'. Please verify the connection information such as the server name, login credentials, and firewall rules for the target server.
Windows logins are not supported in this version of SQL Server.
If I remove TargetConnectionString from the publish profile, or change Integrated Security to False, then publish command works perfectly.
We did a comparison of decompiled versions of sqlpackage 140 and 150 and looks like for some reason builder.IntegratedSecurity is not set to false anymore when username and password are specified
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (1 by maintainers)
@zarochi yes I omitted some stuff from the path to remove our artifacts name. We are using VS .sqlproj projects and they have publish profiles to set some publish settings. I am using classic releases, that’s the yml it shows for a publish task (I removed some names here as well)
@zarochi as a workaround we are now running powershell script to modify the profile and change Integrated Security to False: