title: Azure: Connection Timeout Expired. The timeout period elapsed during the post-login phase
body: <p>We got the error below hundreds of time this morning:</p>
  
  <pre><code>System.Data.SqlClient.SqlException (0x80131904): Connection Timeout Expired.  The   timeout period elapsed during the post-login phase.  The connection could have timed out while waiting for server to complete the login process and respond; Or it could have timed out while attempting to create multiple active connections.  The duration spent while attempting to connect to this server was - [Pre-Login] initialization=1; handshake=14; [Login] initialization=0; authentication=0; [Post-Login] complete=14008;  ---&gt; System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out
  at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
  at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
  at System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObject stateObj, UInt32 error)
  at System.Data.SqlClient.TdsParserStateObject.ReadSniSyncOverAsync()
  at System.Data.SqlClient.TdsParserStateObject.TryReadNetworkPacket()
  at System.Data.SqlClient.TdsParserStateObject.TryPrepareBuffer()
  at System.Data.SqlClient.TdsParserStateObject.TryReadByte(Byte&amp; value)
  at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean&amp; dataReady)
  </code></pre>
  
  <p>How come we got timeouts? We get this error event when we connect using Management Studio and it's often really slow.</p>
  
  <p>The default SQL timeout is 15 seconds. Should we set it to 120 seconds? IT looks to me like a performance issue in Azure.</p>
  
  <p>Any thought?</p>
  
  <p>Thanks,</p>
  
  <p>Stéphane</p>