无法从 Azure WebJob 连接到 AWS RDS SQL 服务器数据库

Cannot connect to AWS RDS SQL Server Database from Azure WebJob

我正在尝试连接到 AWS RDS 中的 SQL Server 2012 数据库。代码在 Debug 中运行,这往往证明连接字符串、AWS 配置...都很好。我用 FTP 检查了部署在 Azure 中的连接字符串,一切都很好,但是当我调用 Connection.Open() 时,出现以下错误(堆栈跟踪的相关部分):

[01/26/2016 12:45:00 > 8c2620: INFO] System.Data.SqlClient.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.) ---> System.ComponentModel.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
[01/26/2016 12:45:00 > 8c2620: INFO]    at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)

我尝试在 Azure 中设置网络安全组(允许所有 ports/all IPs/TCP/UDP In/Out)。它没有帮助,但我不能完全理解 WebJob 是否受此安全组的影响(我是 Azure 的新手,发现界面有点混乱)。有没有办法 link 将政策应用到工作中,或者政策是否适用于服务器范围?

我应该提到我正在为 AWS 和 Azure 使用免费帐户(这可能会限制我的选择?)

有人遇到过这个问题吗?有人有什么提示吗?

提前致谢

将此添加为答案,以便其他人也可能受益

首先检查您是否拥有托管 RDS 实例时创建的默认数据库安全组。

如果是这样,根据这个 AWS link,他们要求您实际删除数据库安全组。

您应该尝试删除这些,然后再次检查连接。

希望对您有所帮助。

好的伙计们,试试这个我很确定它会起作用
它对我有用
1. 进入安全组。
2. 选择默认组。
3. 转到入站组。
4. 单击编辑,然后将源选项从自定义更改为任意位置。
5.保存。

就是这样
如果有效请回复

莫哈巴萨姆