- I created an ASP.NET Core Web API and deployed it in Azure as an App Service.
- I created a Hybrid Connection and installed the Hybrid Connection Manager on the On-Premise Database Server, set the Hybrid Connection Status to Connected (Successfully connected the App Service with On-Premise Db Server).
- When sending Get Request or accessing the Web API on the web browser or Postman
The Result I receive is:
500 - The request timed out. The web server failed to respond within the specified time.
When developing the Web API on my local machine it works smoothly and I could connect to the On-Premise through a VPN connection. I also added this piece of code
services.AddDbContext<RepositoryContext>(o => o.UseSqlServer(connectionString, sqlServerOptionsAction: sqlOptions =>
{
sqlOptions.EnableRetryOnFailure(
maxRetryCount: 5,
maxRetryDelay: TimeSpan.FromSeconds(60),
errorNumbersToAdd: null);
}));