[ASP.NET Core] 連接 Sql Server 可用性群組時發生 SqlException

A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: SSL Provider, error: 0 - The wait operation timed out.)
---> System.ComponentModel.Win32Exception (258): The wait operation timed out.

調整方向

在連線字串添加 MultiSubnetFailover=True, 以及可另外添加 Connection Timeout(預設為15秒)

參考資料

高可用性、嚴重損壞修復的 SqlClient 支援

SqlConnection.ConnectionTimeout 屬性