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

标签 sql-server entity-framework azure azure-sql-database

我们最近在生产部署过程中将客户端迁移到 SQL Azure 平台。从所有外表来看,它都是成功的:连接到它的网络应用程序都在工作。

但是,当我们查看 Azure 监视器时,我们看到许多失败的连接。我们还没有找到太多文档来解释连接失败的原因。我们的用户都没有报告问题。有谁知道这是怎么回事吗?

enter image description here

使用本文中的示例查询 ( View Connection Issues on an SQL Azure Instance )

SELECT      
            [Date From] = EL.[start_time],
            [Date To] = EL.[end_time],
            [Database Name] = EL.[database_name],
            [Event Type] = EL.[event_type],
            [Event Sub Type] = EL.[event_subtype_desc],
            [Description] = EL.[description],
            [Additional Data] = EL.additional_data
FROM sys.event_log EL
WHERE EL.event_type != 'connection_successful'
AND EL.event_subtype_desc != 'idle_connection_timeout'
ORDER BY [Date From] DESC

我们看到这样的结果:

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 端可能有一个后端进程无法在新实例中正常运行,但此后要么停止要么已修复,因为我们没有更改任何内容。我将让它再放置几天,如果我们没有看到任何更多问题,请将其归因于环境设置故障。

enter image description here

这是大约一周后的状态。不是一个经常使用的网站,但没有任何连接错误的迹象。

enter image description here

关于sql-server - SQL Azure - 连接失败 - 但没有问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16109930/

相关文章:

sql-server - SQL Server 更新不更新小数

java - 从 jTDS JDBC 驱动程序迁移到 Microsoft JDBC

sql-server - SQL Server 需要不同的日期格式

sql-server - 解析TSQL脚本并返回表和列的使用情况

c# - 如何使用 Entity Framework 比较 Linq to SQL 中 DateTime 类型中没有时间的日期?

javascript - 带有 ODataConventionModelBuilder 的 Breeze js AutoGeneratedKeyType 始终为 'none'

git - Azure Git 部署到站点文件夹而不是 wwwroot

php - 将业务逻辑放在实体中

azure - 在 Azure DevOps 发布管道中自动创建标签

Azure 搜索域(dns 后缀)