Azure网站有时无法连接到SQL Azure数据库

Can Poyrazoglu

我已经在Azure中测试了一个网站大约一个月(免费试用),现在我订阅了“按需付费”服务。当我进行免费试用时,我完全没有连接问题。现在,我再次部署到一个按使用量付费订阅创建的新网站,该网站具有与上一个相同的设置(缩放模式等)。但是,现在当我导航到站点时,它有时无法连接到数据库:

Server Error in '/' Application.
A connection attempt failed because the connected party did not properly respond after
a period of time, or established connection failed because connected host has failed to
respond
Description: An unhandled exception occurred during the execution of the current web
request. Please review the stack trace for more information about the error and where
it originated in the code.

Exception Details: System.ComponentModel.Win32Exception: A connection attempt failed 
because the connected party did not properly respond after a period of time, or
established connection failed because connected host has failed to respond

Source Error:

An unhandled exception was generated during the execution of the current web request.
Information regarding the origin and location of the exception can be identified using
the exception stack trace below.

Stack Trace:


[Win32Exception (0x80004005): A connection attempt failed because the connected party 
did not properly respond after a period of time, or established connection failed 
because connected host has failed to respond]

[SqlException (0x80131904): 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: TCP Provider, error: 0 - A connection attempt
failed because the connected party did not properly respond after a period of time, or
established connection failed because connected host has failed to respond.)

我尝试刷新页面并连接。几分钟后,当我再次尝试时,有时会再次遇到相同的错误,但有时却不会。在免费试用模式下,我从未遇到任何连接问题。为什么会发生这种情况?如何预防此问题?

CSharpRocks

在云环境中可能会出现暂时性错误。假设数据库调用失败,如果您在几毫秒后重试,则该调用现在可以正常工作。为了避免这些错误,您需要实现重试逻辑。如果您使用Entity Framework 6,则很幸运,因为它已在以下网址中发布:http : //msdn.microsoft.com/zh-CN/data/dn456835以下是有关如何实现此功能的快速视频:http:// www。 azurerocks.com/0_oaw-merMw

您还可以使用企业库瞬态故障处理应用程序块:http : //msdn.microsoft.com/zh-cn/library/hh680934(v=pandp.50).aspx

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

有时无法从Azure网站访问Azure SQL数据库

来自分类Dev

JBoss有时无法连接到数据库

来自分类Dev

无法连接到我的Azure SQL数据库

来自分类Dev

Azure云服务仅在写操作时无法连接到SQL数据库

来自分类Dev

Azure云服务仅在写操作时无法连接到SQL数据库

来自分类Dev

python连接到Azure数据库

来自分类Dev

无法将Azure WebJob连接到Azure VM上的SQL数据库

来自分类Dev

通过pyodbc连接到Azure SQL数据库

来自分类Dev

通过Powershell连接到Azure SQL数据库

来自分类Dev

通过Powershell连接到Azure SQL数据库

来自分类Dev

Azure数据库同步

来自分类Dev

连接到Azure数据库的Azure网站在本地运行良好,但未部署

来自分类Dev

Azure上的.NET Core无法连接到SQL Server数据库

来自分类Dev

客户端在连接到Azure SQL数据库时遇到问题

来自分类Dev

无法用数据填充Azure数据库。WebPage已连接到数据库,但不想创建表

来自分类Dev

我似乎无法从Azure Linux VM连接到MySQL服务器的Azure数据库

来自分类Dev

JDBC 连接到 Azure 中的 Java 数据库

来自分类Dev

从运行PHP 5.5的Azure网站连接Azure SQL数据库吗?

来自分类Dev

自动缩放Azure SQL数据库

来自分类Dev

Azure SQL数据库操作超时

来自分类Dev

Azure Sql数据库归档

来自分类Dev

Windows Azure SQL数据库

来自分类Dev

SQL Azure数据库设计问题

来自分类Dev

Azure SQL 数据库更新性能

来自分类Dev

管理 SQL Azure 数据库

来自分类Dev

Azure Sql 数据库查询

来自分类Dev

Azure SQL 数据库发布问题

来自分类Dev

Azure Web作业-如何连接到Azure MS SQL数据库?

来自分类Dev

Azure Web作业-如何连接到Azure MS SQL数据库?