Web App: API Failure During Database Request — HTTP 500 Errors and App Instability

saikumar-7223 0 Reputation points
2026-09-22T19:07:57.01+00:00

Problem description

I am experiencing issues with my web application, which is a Windows-based Web App service. Around 17:37 UTC, the application started returning HTTP 500 responses, and during this period, the app was not consistently healthy, showing restart, crash, and recycle activities. I need assistance in diagnosing the root cause of these errors and stabilizing the application.

Environment

Web App (Windows) in the region not specified in the case information.

What I've already tried

I reviewed the available case details and diagnostic information. I have attempted to follow the troubleshooting steps suggested, including checking logs and monitoring activity, but the issue persists.

Current status

Currently, I have not confirmed a definitive cause. I am seeking guidance on further steps to identify and resolve the underlying problem to restore application stability.

Azure App Service
Azure App Service

Azure App Service is a service used to create and deploy scalable, mission-critical web apps.


2 answers

Sort by: Most helpful
  1. Abhinaba Das 115 Reputation points Microsoft External Staff Moderator
    2026-09-23T20:04:17.14+00:00

    Hi @saikumar-7223

    Thank you for providing the additional details.

    Based on the behavior you described, where the API works successfully with smaller amounts of data but encounters failures when processing 6,000+** SQL records or when the operation runs for several **minutes, the request duration is an important factor to consider.

    For Windows-based** Azure App Service, Microsoft documents that a web request can time out after approximately 230 **seconds if the application does not return a response. Therefore, long-running database operations should generally not depend on keeping a single HTTP request open until all processing has completed.

    For this scenario, I recommend the following:

    Avoid** processing the entire large dataset in one synchronous API **request. Where possible, divide the database operation into smaller batches so each request can complete more quickly.

    For** inherently long-running processing, use a background-processing **approach. Microsoft recommends Azure WebJobs for background processing when work cannot reasonably complete within the web request.

    Because you are seeing HTTP** **500, please also review the application and SQL/database logs around the failed request. This is important because an application or SQL exception could also be occurring before the App Service request timeout is reached.

    If smaller requests consistently succeed while only the long-running requests fail, redesigning the operation so that the API accepts the request and the actual processing continues asynchronously would be a more suitable approach than keeping the API connection open for the complete database operation.

    Also, there isn't enough evidence here to conclude that 6,000** records itself is an Azure App Service **limit. The more relevant consideration is how long the synchronous HTTP request remains active and whether the application/database encounters an exception during that processing.

    Reference:

    If the answer is helpful, please do click "Accept the answer” and Yes, this can be beneficial to other community members.

    Was this answer helpful?

    0 comments No comments

  2. saikumar-7223 0 Reputation points
    2026-09-22T19:48:17.8266667+00:00

    Hi,
    When the api trying to be inserting SQL records more than 6000 records or exceeds 3 mins the api gives error by throwing 500. Thats the main issue, its good with lower data such as minimum records.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.