Is there any way to increase the request timeout for azure web apps?
If I delay the request by anything over 2 minutes or so the request fails with no error (blank p
Hope this would be some help https://azure.microsoft.com/en-us/blog/new-configurable-idle-timeout-for-azure-load-balancer/. But I think it's bad idea keep request while some heavy job being executed. Imho, you'd better implement background job and check it status from client from time to time.
No, you cannot increase the timeout for Azure App Services (it is 230 seconds). You can move to a cloud services or IIS hosted on a VM where you have control over those settings. You can also move to an async model where the client makes a request, gets some sort of ticket or identifier that is can poll back to see if the processing is done. There are many examples of async type models for web apps out there you can choose from. Ref:https://social.msdn.microsoft.com/Forums/en-US/05f254a6-9b34-4eb2-a5f7-2a82fb40135f/time-out-after-230-seconds?forum=windowsazurewebsitespreview
You can use my trick code here to by-pass 230s limit. In summary, we just keep writing empty html value "\r\n" to response to let ALB know that we are returning data, but actually we are processing the request.
Sample code
Try making your action Async if it is supposed to be long running to avoid deadlocks on your web server:
public async Task<ActionResult> Index()
{
await Task.Delay(230000);
return View();
}
And you can set script timeout in the code in the controller:
HttpContext.Current.Server.ScriptTimeout = 300;
Note that HttpContext is instantiated on a per request basis, so it would be back to the default value on the next request
You have to some changes in web.config
<system.webServer>
<monitoring>
<triggers>
<statusCode>
<addstatusCode="500"subStatusCode="0"win32StatusCode="0"
count="10"timeInterval="00:00:30" />
</statusCode>
</triggers>
<actionsvalue="Recycle" />
</monitoring>
For more:
Connection Timeout (Timeout Expired) on Azure Web App Site
You can deploy the web app using the automation script and add this line under "resources":
{
"name": "WEBSITES_CONTAINER_START_TIME_LIMIT",
"value": 1800
},
where value is by default 230, but can be increased up to 1800. You can also add a New Setting under Application Settings, named WEBSITES_CONTAINER_START_TIME_LIMIT and with the value of seconds you want.