0

I am using self Hosted Agent (Windows 2019) with SQL Server 2019 in Azure DevOps. I am using "SQL Server database deploy" Task. And trying to deploy a dacpac with the database project created using VS2019. I am getting an error as

"Could not deploy package. Unable to connect to master or target server. You must have a user with the same password in master or target server."

When I check the task log, SQLPackage.exe was executed from the below path.

"C:\Program Files (x86)\Microsoft SQL Server\140\DAC\bin\SqlPackage.exe"

But DAC folder is missing in the below path

"C:\Program Files (x86)\Microsoft SQL Server\150"

When I check the capabilities of agent pool, it showing the path of SQLPackage as

"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\140\SQLPackage.exe".

But SQLPackage.exe is also available in the below path

"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\150"

Some links says it was known issue. And some links suggest to use Powershell task instead of "SQL Server database deploy" Task.

Please anyone let me know how to fix this issue.

VKD
  • 633
  • 2
  • 12
  • 28

1 Answers1

0

What do you mean 'SQL Server database deploy Task' the WinRM SQL Server DB Deployment task or Azure SQL Database Deployment task? Here, about your issue, we have some suggestions:

  1. Make sure SQL Server is running
  2. Use the correct SQL Server connection name
  3. Double-check SQL Server username/password
  4. SQL Server user needs correct server role
  5. Try to upgrade the Microsoft.SqlServer.DacFx.x64 package from 140.3745.1 to latest stable.
  6. Or you can try to Change the dacpac compatibility from 150 to 140.
Felix
  • 1,104
  • 3
  • 6