When I try to deploy a DACPAC using the "WinRM - SQL Server DB Deployment" Task, I receive the following error message:
"System.Exception: * Could not deploy package. Unable to connect to master or target server 'TestDB2'. You must have a user with the same password in master or target server 'TestDB2'."
I can successfully deploy IIS apps to the machine using the same details, just not the DACPAC
Can you please assist?
@brett3210 , thanks for reporting the issue.
Can you please ensure that the username and password is valid for the corresponding server ?
Can you queue a release with system.debug = true and share the logs ?
Thanks, yes the same username and password Environment Variables are used to successfully deploy the IIS app.
Attached is the log file.
VSTS RM DB Deploy Debug.txt
Is the .\ZZZ also has permissions to Sql Server running on target machine? If no you might want to use "SQL Authentication" instead of default Windows Authentication and provide appropriate creds there.
Yes, the account does have the permissions. I can perform the steps manually on the target machine under that account
The following command gets executed on the target server in admin mode. Can you try this command in admin command prompt on remote machine.
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\130\SqlPackage.exe" /SourceFile:"C:\temp\VS\Release\1.1.1.41.2TestSQLServerDBProj1.1.1.41.dacpac" /Action:Publish /TargeServerName:"XXX.cloudapp.azure.com" /TargetDatabaseName:"TestDB2"
If it doesn't work, can you check TargetServerName with localhost if it is default sql instance.
Thanks. It failed (same error as above) with the cloudapp server name, but "successfully published database" with "localhost"
Thanks for confirming I am closing the issue. Issue is your SQL Server instance name is not matching and hence the failure.
In our case, the user's password had changed - after a few failed releases/tries, the Sql Server account was locked out, and SqlPackage was giving us the same message "You must have a user with the same password in master or target server BLAH BLAH BLAH". Hope this helps the others out there.