So, I have a web app running on Azure and there is a API endpoint which will handle a long process (about hour I can said). It is fine when running local on visual studio, but when it go to azure, it fail after request start 55 seconds.
I have research arount this issues over every platform, I alter a chances to add on this line of code on the end point.
System.Web.HttpContext.Current.Server.ScriptTimeout = 10000;
So now it able to extend to timeout, but still fail to process after 3 minute 50 second. Upon this point, I have find out there is other thing call Load Balancer. They all saying that the Azure Load Balancer will auto kill all request after 4 minutes. So I stuck on this place.
So I have try all these solution.
1.System.Web.HttpContext.Current.Server.ScriptTimeout = 10000; 2.System.Net.ServicePointManager.SetTcpKeepAlive(true, 30000, 30000); 3.Use Start New Thread to handle long process and return http status code to client initial that the process is started. 4.Make long process as another async function
What I trying to achieve is quite simple, a long process function that can be trigger by scheduler task or manually(AJAX call).
Any suggestion ?