Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSDT failing to publish: "Unable to connect to master or target server"

I'm attempting to use SSDT to publish to a SQL Server database in Azure. When I do so, I am seeing the following error:

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

Ignoring the fact that it's listing a database name as the server name in the error, I'm not sure how to resolve it. When I specify the target database, I can successfully Test Connection. I can also connect using the same creds to the database through SSMS.

After researching the error, it seems like it is often that the firewall for the database in Azure does not include the IP address of the machine you're publishing from. It not only contains my IP, but I added another firewall rule to allow every IP (0.0.0.0-255.255.255.255) to eliminate the firewall as a potential cause of the problem.

Any ideas?

like image 897
im1dermike Avatar asked Oct 13 '17 18:10

im1dermike


People also ask

How do I connect to Ssdt?

In Solution Explorer, right-click the WideWorldImporters-SSDT project, click Import, then click Database. In the Import Database window, click Select Connection. In the Connect window, configure your connection properties, then click Connect. In the Import Database window, click Start.

What is SqlPackage EXE?

SqlPackage.exe is a command-line utility that automates the following database development tasks by exposing some of the public Data-Tier Application Framework (DacFx) APIs: Version: Returns the build number of the SqlPackage application. Added in version 18.6. Extract: Creates a data-tier application (.


1 Answers

This is a known issue. This happens due to the new compatibility level 140 for newly created SQL Azure databases. The issue has been documented here and updating SSDT from here to the latest version may solve the issue.

Alternatively, you can change the compatibility level of your database to 130.

ALTER DATABASE database_name   
SET COMPATIBILITY_LEVEL =  130;

Hope this helps.

like image 52
Alberto Morillo Avatar answered Sep 28 '22 07:09

Alberto Morillo