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’


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 here.

You can also get this error if your client computer fails to pass the firewall rules for the server.

Comments (2)

  1. Amruta says:

    Hi,

    I am also getting same error,
    sqlpackage.exe : * Could not deploy package. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (* Could not deploy package.:String) [], RemoteException + FullyQualifiedErrorId : NativeCommandError Unable to connect to master or target server ‘TestDB’. You must have a user with the same password in master or target server ‘TestDB’.

    Am deploying AzureSQLDB by dacpac(130) and my Azure SQLServer is in “East US” region. I get above error specifically for this region.
    If I change the region to “South Central US”, then DB gets deployed successfully with 130 dacpac deployment.

    When I tried deploying DACFramework(140), then DB got deployed in “East US” region also. But I don’t want to change the framework, also cannot change my DB region as my SQLServer region is in “East US”.

    Is there any region issue in Dacpac(130) deployement?

    Thank you

    1. Hi Amruta,

      as Azure SQL DB is a live platform and always updated you should always use the latest version for deployment.

      Regards,
      Yochanan.

Skip to main content