具有混合连接的 Azure 应用服务无法访问本地 SQL 服务器

Azure app service with hybrid connection can't access on prem SQL Server

我有一个启用了混合连接的应用程序服务(在与 SQL 服务器位于同一网络中的虚拟机上)供我访问我不拥有的预置 SQL 服务器.但是,连接一直很不稳定。

我能够访问 SQL 服务器,可能只有 5% 的尝试,但大多数时候我只是收到错误

One or more errors occurred. (A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.

我可以通过虚拟机上的 SSMS 登录。连接字符串应该没问题,因为我可以在本地访问(本地网络与 SQL 服务器是同一个网络)。

命名实例使用混合连接不支持的动态端口和 UDP。建议您像 Nick 提到的那样使用静态端口。请参阅此文档 Connect to on-premises SQL Server from a web app in Azure App Service using Hybrid Connections 以获取更多信息。

provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.

你的 Windows 是什么版本?当 Windows 版本不包含 TLS_DHE 的前导零修复时,将显示此错误消息。您可以尝试更新 windows 版本或禁用 [​​=18=] 密码来解决此问题。请参考this document.