0

Below is the API that times out. The API is deployed in Azure. The below api executes without any issues on local environment IIS 10.0, The execution fails to enter controller. Why does it timeout on Azure? And how do I stop the request from timing out.

            [Route("count")]
            [HttpPost]
            public async Task<IHttpActionResult> PostStockCountAsync(CreateStockCountRequest request)
            {
                var query = Map<CreateStockCountRequest, CreateStockCountCommand>(request);

                var stocks = await SendAsync(query);

                return Ok(stocks);
            }

Request Object. The items collection contains 241 items. The size is nearly 41kb

public class CreateStockCountRequest
    {
        public Guid Id { get; set; }
        public IList<StockCountItem> Items { get; set; }
        public Guid OutletId { get; set; }
    }

public class StockCountItem
    {
        public Guid ProductId { get; set; }
        public string ProductName { get; set; }
        public decimal CurrentAmountSystem { get; set; }
        public Decimal AverageCostPrice { get; set; }
        public decimal CurrentAmountActual { get; set; }
        public bool Checked { get; set; }
        public Guid InventoryId { get; set; }

        public DateTime? CountedOn { get; set; }
    }

It did not work Even after adding the below config entry.

<httpRuntime targetFramework="4.5.2" maxRequestLength="102400" /> 

The Deserialization is not happening.

sham
  • 691
  • 8
  • 28
  • Azure has a timeout for webapps that is not configurable, if you want to bypass this you need to run your site under a Virtual Machine on Azure. For tasks that will take certain time it recommends WebJobs – CREM May 30 '18 at 13:21
  • https://stackoverflow.com/questions/38673318/azure-asp-net-webapp-the-request-timed-out/38676086#38676086 – CREM May 30 '18 at 13:24
  • What exactly error message you get for timeout? – Jatin Parmar May 30 '18 at 13:36
  • @JatinParmar 500 - The request timed out.

    500 - The request timed out.

    The web server failed to respond within the specified time.
    – sham May 30 '18 at 14:05
  • @sham Could you show `SendAsync` method? – Win May 30 '18 at 15:11
  • @Win the execution never reaches that point. The deserialization takes more time than expected. The execution never reaches the controller – sham May 31 '18 at 12:51
  • Possible duplicate of [Azure ASP .net WebApp The request timed out](https://stackoverflow.com/questions/38673318/azure-asp-net-webapp-the-request-timed-out) – Jerry Liu Jun 06 '18 at 08:03

0 Answers0