Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sql-server/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/entity-framework/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql server SQL Azure-连接失败-但没有问题?_Sql Server_Entity Framework_Azure_Azure Sql Database - Fatal编程技术网

Sql server SQL Azure-连接失败-但没有问题?

Sql server SQL Azure-连接失败-但没有问题?,sql-server,entity-framework,azure,azure-sql-database,Sql Server,Entity Framework,Azure,Azure Sql Database,我们最近在生产部署过程中将一个客户端迁移到SQLAzure平台。从表面上看,它是成功的:连接到它的网络应用程序都在工作 然而,当我们查看Azure监视器时,我们看到许多失败的连接。我们还没有找到太多的文档来解释什么构成了失败的连接。而且我们的用户都没有报告问题。有人知道这是怎么回事吗 使用本文()中的示例查询 我们看到的结果如下: 2013-04-19 16:40:00.0000000 2013-04-19 16:45:00.0000000 [DATABASE] connection_fai

我们最近在生产部署过程中将一个客户端迁移到SQLAzure平台。从表面上看,它是成功的:连接到它的网络应用程序都在工作

然而,当我们查看Azure监视器时,我们看到许多失败的连接。我们还没有找到太多的文档来解释什么构成了失败的连接。而且我们的用户都没有报告问题。有人知道这是怎么回事吗

使用本文()中的示例查询

我们看到的结果如下:

2013-04-19 16:40:00.0000000 2013-04-19 16:45:00.0000000 [DATABASE]  connection_failed   blocked_by_firewall Client IP address is not allowed to access the server.  NULL
2013-04-19 16:40:00.0000000 2013-04-19 16:45:00.0000000             connection_failed   blocked_by_firewall Client IP address is not allowed to access the server.  NULL
2013-04-19 16:35:00.0000000 2013-04-19 16:40:00.0000000 [DATABASE]  connection_failed   blocked_by_firewall Client IP address is not allowed to access the server.  NULL
2013-04-19 16:35:00.0000000 2013-04-19 16:40:00.0000000             connection_failed   blocked_by_firewall Client IP address is not allowed to access the server.  NULL
2013-04-19 16:30:00.0000000 2013-04-19 16:35:00.0000000 [DATABASE]  connection_failed   blocked_by_firewall Client IP address is not allowed to access the server.  NULL
2013-04-19 16:30:00.0000000 2013-04-19 16:35:00.0000000             connection_failed   blocked_by_firewall Client IP address is not allowed to access the server.  NULL
2013-04-19 16:25:00.0000000 2013-04-19 16:30:00.0000000 [DATABASE]  connection_failed   blocked_by_firewall Client IP address is not allowed to access the server.  NULL
2013-04-19 16:25:00.0000000 2013-04-19 16:30:00.0000000             connection_failed   blocked_by_firewall Client IP address is not allowed to access the server.  NULL
2013-04-19 16:20:00.0000000 2013-04-19 16:25:00.0000000 [DATABASE]  connection_failed   blocked_by_firewall Client IP address is not allowed to access the server.  NULL
2013-04-19 16:20:00.0000000 2013-04-19 16:25:00.0000000             connection_failed   blocked_by_firewall Client IP address is not allowed to access the server.  NULL
2013-04-19 16:15:00.0000000 2013-04-19 16:20:00.0000000 [DATABASE]  connection_failed   blocked_by_firewall Client IP address is not allowed to access the server.  NULL
以及我们的连接字符串示例,如请求所示:

  <add name="[MyContext]"
     providerName="System.Data.SqlClient"
     connectionString="
      Server=tcp:[machine].database.windows.net,1433;
          Database=[database];
          User ID=[user]@[machine];
          Password=[password];
          Trusted_Connection=False;
          Encrypt=True;
          Connection Timeout=30;"/>

因此,从发布的第一天起,我们就再也没有看到失败的连接。我目前的想法是,Azure端可能存在一个后端进程,该进程在新实例中无法正常运行,但由于我们没有更改任何内容,该进程已经停止或修复。我会再等几天,如果我们没有看到任何问题,就把它归咎于环境设置的小故障

这是一周后的状态。不是一个使用率很高的站点,但是没有任何连接错误的迹象


我也遇到了同样的问题,这让我很困惑,直到我意识到我打开了一个SQL Server Management Studio实例并连接到了我的家庭办公机器上,我的ISP更改了我的IP地址!我一关闭SSMS,失败的连接就停止了。感谢OP提供了到SQL查询的链接,了解它也很有用

你退房了吗?我最近刚看到同一篇文章。查看更新后的问题,我在事件日志中添加了查询结果,它们似乎都是“被防火墙阻止”错误,即使我们的用户都没有报告问题……连接到SQL Azure的应用程序从何处运行?您确定已为所有需要它的IP地址提供访问权限吗?是否有任何应用程序通过一系列IP进行连接或动态分配IP?您可以发布连接字符串的格式吗?数据库由1个托管web应用程序和1个通过托管citrix访问的内部应用程序访问。对于web主机,我们添加了整个1-255范围的IP地址,对于内部应用程序,只添加了单个IP地址。到目前为止,双方都没有出现问题的报告。问题中添加了连接字符串。我们遇到了相同的问题,但我们没有来自任何系统的任何外部访问,它都是Azure托管的。我们每天有500多个这样的防火墙块。Azure服务是允许访问的,但最近我们不得不添加Azure托管机器的IP,因为我们看到一些实例,即使选中了允许的设置,它们也会被阻止。即使没有抛出这些错误,我们仍然可以看到问题弹出。这似乎是一个更大的问题。我在一个Azure网站上与Mongo、Memcached和Redis有同样的问题。(全部3个自托管)删除了对Redis的依赖,将Memcached更改为Azure缓存,将Mongo托管更改为MongoLabs。问题不再出现了。今天,我用类似的配置设置了一个staging env,问题又出现了。
  <add name="[MyContext]"
     providerName="System.Data.SqlClient"
     connectionString="
      Server=tcp:[machine].database.windows.net,1433;
          Database=[database];
          User ID=[user]@[machine];
          Password=[password];
          Trusted_Connection=False;
          Encrypt=True;
          Connection Timeout=30;"/>