Blog Post

Azure Database Support Blog
1 MIN READ

Deployment fails with 'Unable to connect to master or target server 'mydb_svr'. You must have a user with the same password in master or target server 'mydb-db'

Azure-DB-Support-Team's avatar
Azure-DB-Support-Team
Copper Contributor
Mar 14, 2019
First published on MSDN on Sep 19, 2017
This will be a very short post to address what appears to be a slight trend in support at the moment.

When attempting a deployment fails with an exception, attempting a deployment of the dacpac for the database via sqlpackage.exe also fails with the error:
'Unable to connect to master or target server 'mydb_svr'. You must have a user with the same password in master or target server 'mydb-db'
This occurs when the deployment is to a recently created database server, deployments to older database servers do not result in the error

Resolution:

There seem to be a few reasons for this error, which is a little misleading

If your SSDT is not up to date you can see this error, this is because the latest compatibility level for Azure DB is 140, and the older sqlpackage.exe does not recognize this it works with compatibility levels up to 130. To resolve this issue you can get the latest version (17.3 version) from https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt .

You can also get this error if your client computer fails to pass the firewall rules for the server.
Updated Mar 14, 2019
Version 2.0

2 Comments

  • mtraudt's avatar
    mtraudt
    Copper Contributor

    I had a similar problem. I was able to fix by upgrading the Microsoft.SqlServer.DacFx.x64 package from 140.3745.1 to 150.4897.1 (latest stable).

  • satishT's avatar
    satishT
    Copper Contributor

    Hi, I am also facing a similar kind of issue and the following are the steps I have followed.

    1. I have VS 2019 database project "TestDBProject" in which SQL objects Tables/Stored Procedure etc. creation scripts available. 

    2. Trying to deploy the TestDBProject.dacpac file of the above project into Azure SQL Database using "Azure SQL Database Deployment" task in VSTS Release pipeline which is throwing the following error.

    Unable to connect to master or target server 'TestDB'. You must have a user with the same password in master or target server 'TestDB'.

    3. So I have tried updating "TestDBProject.sqlproj"(by opening it in notepad) the DSP with the below 2 options and created the respective "TestDBProject.dacpac" file by building the project.

    <DSP>Microsoft.Data.Tools.Schema.Sql.Sql130DatabaseSchemaProvider</DSP>

    <DSP>Microsoft.Data.Tools.Schema.Sql.Sql140DatabaseSchemaProvider</DSP>

    4. I even added the following MSBuild Arguments in the Build pipeline "Visual Studio Build" Task, but no use still getting above same error.

    /p:AllowIncompatiblePlatform=true

    /p:DSP=Microsoft.Data.Tools.Schema.Sql.SqlAzureV12DatabaseSchemaProvider

     

    Can you pl. let me know what am I missing or any suggestions are appreciable.