SSDT 无法发布:“无法连接到主服务器或目标服务器" [英] SSDT failing to publish: "Unable to connect to master or target server"

查看:36
本文介绍了SSDT 无法发布:“无法连接到主服务器或目标服务器"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 SSDT 发布到 Azure 中的 SQL 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:

无法连接到主服务器或目标服务器DATABASE_NAME".您必须在主服务器或目标服务器DATABASE_NAME"中拥有一个密码相同的用户.

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

忽略它在错误中将数据库名称列为服务器名称这一事实,我不知道如何解决它.当我指定目标数据库时,我可以成功测试连接.我还可以使用相同的凭据通过 SSMS 连接到数据库.

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.

在研究错误后,似乎 Azure 中数据库的防火墙通常不包含您发布信息的机器的 IP 地址.它不仅包含我的 IP,而且我添加了另一个防火墙规则以允许每个 IP (0.0.0.0-255.255.255.255) 消除防火墙作为问题的潜在原因.

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.

有什么想法吗?

推荐答案

这是一个已知问题.这是由于新创建的 SQL Azure 数据库的新兼容性级别 140 造成的.该问题已记录在 这里 和更新SSDT 从这里到最新版本可能会解决问题.

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.

或者,您可以将数据库的兼容级别更改为 130.

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

ALTER DATABASE database_name   
SET COMPATIBILITY_LEVEL =  130;

希望这会有所帮助.

这篇关于SSDT 无法发布:“无法连接到主服务器或目标服务器"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆