Azure SQL is very different from SQL SQL. When Azure SQL Server reboots or drops, it will disconnect several connections, and when you reconnect, you will receive a message to another SQL Server.
However, with TCP connections, you do not know if the other end terminated the connection unless you actually sent information to it, so this error occurs.
As soon as your code finds out about the end of the connection, it establishes a new connection for the next request, which will work fine.
With Entity Framework 6, you can deal with Transitional Error Handling using SQL Azure using Entity Framework
In your DBConfiguration class, you need to set SetExecutionStrategy and configure it. Just create a new class in your project and inherit it from DbConfiguration.
public class MyConfiguration : DbConfiguration { public MyConfiguration() { SetExecutionStrategy( "System.Data.SqlClient", () => new SqlAzureExecutionStrategy(1, TimeSpan.FromSeconds(30))); } }
Details on Connection / Retry Failover Logic (EF6 onwards)
Adam pedley
source share