Increase azure web app request timeout

后端 未结 6 1941
予麋鹿
予麋鹿 2020-12-15 03:53

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

6条回答
  •  天涯浪人
    2020-12-15 04:18

    Try making your action Async if it is supposed to be long running to avoid deadlocks on your web server:

    public async Task 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

提交回复
热议问题