我正嘗試連接到AWS RDS中的SQL Server 2012數據庫。代碼在調試中起作用,這往往證明連接字符串,AWS配置...都很好。我檢查部署在Azure中與FTP連接字符串,它是一切都很好,但是當我打電話Connection.Open(),我得到以下錯誤(堆棧跟蹤的相關部分):無法從Azure WebJob連接到AWS RDS SQL Server數據庫工作
[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中設置網絡安全組(允許所有端口/所有IP/TCP/UDP輸入/輸出)。它沒有幫助,但我並沒有完全理解WebJob是否受到這個安全組的影響(我對Azure是新手,並且發現界面有點混亂)。有沒有辦法將策略與作業相關聯,還是應用服務器範圍的策略?
我要指出,我使用的免費賬戶都AWS和Azure的(這可能會限制我的選擇嗎?)
沒有人吃出問題?有沒有人有任何提示?
在此先感謝
您是否還在AWS上設置安全組並打開必要的端口? – vmachan
@vmachan我確信AWS配置是確定的,因爲SQL查詢在我的筆記本電腦上工作。我只是檢查了一下,顯然RDS自己創建了一個安全組:rds-launch-wizard從RDS管理控制檯創建 – vpi
是的,按照[AWS link](http://docs.aws.amazon.com/AmazonRDS /latest/UserGuide/Overview.RDSSecurityGroups.html),他們要求你實際刪除數據庫安全組..你可能想要檢查它.. – vmachan