Azure混合连接管理器不起作用 [英] Azure hybrid connection Manager does not work

查看:106
本文介绍了Azure混合连接管理器不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要求

我有一个内部部署 SQL Server 和一个 Azure webApp服务,需要互相交谈。我在与SQL服务器位于同一局域网中的另一台计算机上安装了混合连接管理器。我们将此计算机称为连接PC

I have an On-Premise SQL Server and an Azure webApp Service that needs to talk each other. I installed Hybrid Connection Manager on another computer which is in the same LAN as the SQL server. Let's refer this computer as the Connection PC.

工作部分


  • 安装和配置很简单,混合连接的状态显示为已连接。

  • 在localhost上测试了WebApp,它工作正常。这意味着asp.net代码没有错

  • 连接PC上的SSMS可以访问和查询SQL DB

  • 我在上面安装了测试SQL DB

  • Installation and configuration was straight forward, status of the hybrid connection showing as connected.
  • Tested the WebApp on localhost, it worked fine. Which means nothing wrong with the asp.net code
  • SSMS on the connection PC can access and query SQL DB
  • I installed a test SQL DB on the connection PC itself and use the WebApp to talk to the test DB instead, It worked fine.

问题 strong>

在localhost上测试正常后,我将ASP.Net WebApp发布到Azure,它给出了以下错误:

After tested ok on localhost, I published ASP.Net WebApp to Azure, it gave following error:

建立与SQL Server的连接时发生与网络相关或特定于实例的错误。服务器未找到或无法访问。验证实例名称正确,并且已将SQL Server配置为允许远程连接。 (提供者:命名管道提供者,错误:40-无法打开与SQL Server的连接)

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

故障排除尝试


  • 这是否意味着必须将混合连接管理器安装在运行SQL Server的同一台计算机上?

  • 我确实尝试过在SQL Server上安装HCM,但它说它不能与Win2008R2一起使用。连接PC上有win2012。因此它可以具有HCM。
    我只是没有时间将SQL Server迁移到另一台服务器。因此,我希望HCM不必在SQL Server上。

连接字符串

在我的Web应用程序中,连接字符串如下。

In my webapp, the connection string is as follows.

connectionString = metadata = res:// / ScaleDataModel .csdl | res:// /ScaleDataModel.ssdl|res://*/ScaleDataModel.msl;provider=System.Data.SqlClient;provider连接字符串= data source = WIN2008R2\DataPlus;初始目录= DataPlus;持久安全性信息= True;用户ID = test;密码= testpass; multipleactiveresultsets = True;应用程序名称= EntityFramework providerName = System.Data.EntityClient

connectionString="metadata=res:///ScaleDataModel.csdl|res:///ScaleDataModel.ssdl|res://*/ScaleDataModel.msl;provider=System.Data.SqlClient;provider connection string="data source=WIN2008R2\DataPlus;initial catalog=DataPlus;persist security info=True;user id=test;password=testpass;multipleactiveresultsets=True;application name=EntityFramework"" providerName="System.Data.EntityClient"

推荐答案

混合连接通过TCP端口通信,因此您需要在其中指定监听静态端口您的连接字符串,例如:

Hybrid Connection communicates via TCP ports thus you need to specify the listening static port in your connection string like:

数据源=服务器名称:端口

Data source=ServerName:Port;

此处是有关您可能遇到的所有问题的实际详细文章

Also here is an actually detailed article about the all problems you may encounter while working with Hybrid Connections.

希望这对您有所帮助。

这篇关于Azure混合连接管理器不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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