有时无法从Azure网站访问Azure SQL数据库 [英] Azure SQL Database sometimes unreachable from Azure Websites

查看:90
本文介绍了有时无法从Azure网站访问Azure SQL数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个asp.net应用程序部署到连接到Azure SQL数据库的Azure网站.在过去的一年中,这种方法一直运行良好,但是上周末,我开始出现连接到数据库的错误,并给出了以下堆栈跟踪信息.

I have a asp.net application deployed to Azure websites connecting to Azure SQL Database. This has been working fine for the last year, but last weekend I have started getting errors connecting to the database giving the following stacktrace.

[Win32Exception (0x80004005): Access is denied]

[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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)]

此错误反复出现几个小时,然后消失了几个小时.该数据库始终可以从我的机器上访问.

This error comes and goes staying a few hours and then goes away for a few hours. The database is always accessible from my machine.

我尝试过的一些事情是:

A few things that I have tried are:

  • 添加全部允许"防火墙规则(0.0.0.0-255.255.255.255)无效
  • 更改连接字符串以将数据库所有者用作凭据无效.
  • 有什么作用是将Azure托管级别更改为其他功能.这可以暂时解决该问题,并且网站可以再访问几个小时.
  • Adding a "allow all" firewall rule (0.0.0.0-255.255.255.255) has no effect
  • Changing the connection string to use the database owner as credential has no effect.
  • what does have effect is to change the azure hosting level to something else. This resolves the issue temporarily and the website can access the database for a few hours more.

该错误开始出现可能是什么情况?自8月以来,该应用程序从未更改过.

What could have have happened for this error to start showing up? The application hasn't been changed since August.

Azure支持人员发现实例上存在套接字和端口耗尽.造成这种情况的根本原因仍然是未知的.

Azure support found that there was socket and port exhaustion on the instance. What the root cause for that is, is still unkown.

推荐答案

Azure支持人员的回答表明,我遇到的连接问题是由于端口/套接字耗尽.这可能是由具有相同托管计划的另一个网站引起的.

The answer from Azure support indicated that the connection issues I was experiencing was due to port/socket exhaustion. This was probably caused by another website on the same hosting plan.

有关通过更改托管服务级别来消除症状的一些答案:

Some answers to why the symptoms were removed by changing hosting service level:

  • 更改托管计划已有一段时间,因为这可以移动虚拟机并关闭所有套接字.
  • 将托管计划从B级更改为S级是有帮助的,因为天青限制了B级的套接字数量.

这篇关于有时无法从Azure网站访问Azure SQL数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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