There is a 230 second timeout for requests that are not sending any data back. Please see the answer of @David Ebbo in following thread.
https://social.msdn.microsoft.com/Forums/en-US/17305ddc-07b2-436c-881b-286d1744c98f/503-errors-with-large-pdf-file?forum=windowsazurewebsitespreview
There is a 230 second (i.e. a little less than 4 mins) timeout for requests that are not sending any data back. After that, the client gets the 500 you saw, even though in reality the request is allowed to continue server side.
So the issue of not receiving response from Web API is related to the timeout limit of Azure Web App. I also test it on my side. Though I set executionTimeout as 10min in web.config.
<httpRuntime targetFramework="4.6" executionTimeout="600" />
If the time of sending response from service side need more than 230s. I will get a 500 error on my client side.
public IEnumerable<string> Get()
{
Thread.Sleep(270000);
return new string[] { "value1", "value2" };
}
I suggest you accept the suggestion of @Thomas. Writing your response to a queue from your Web API and get the response which you needed from the queue.
So, is there no method to bypass this timeout?
The 230 sec limit also could be proved in following article.
there is a general idle request timeout that will cause clients to get disconnected after 230 seconds.
https://github.com/projectkudu/kudu/wiki/Configurable-settings
I haven't found any ways to modify this timeout for Azure Web App. Please try the workarounds which I mentioned above.