Azure Web App is not available and returns Bad Gateway 502 error at the beginning of each 4th hour during the day.

Alexander Menukhin 20 Reputation points
2024-07-29T23:00:30.8666667+00:00

Azure Web App (.net 4.8) is not available and returns Bad Gateway 502 error on POST or GET requests at the beginning of each 4th hour during the day. The application is the only one in the app plan.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,914 questions
0 comments No comments
{count} votes

Accepted answer
  1. ajkuma 26,721 Reputation points Microsoft Employee
    2024-08-01T16:01:56.3466667+00:00

    Alexander Menukhin,

    edit: Alexander confirmed that "Switching off automatic scale up option has resolved the issue."

    To better assist you on this, what App Service Plan (ASP) are you leveraging?
    What Azure subscription type are you using? In which region is your webapp provisioned?

    I understand from your issue description - the issue persists even after scaling up the app plan and integrating Application Insights, which hasn't revealed any suspicious activity during the periods in question. The memory consumption and processor utilization are also within normal ranges.

    if you haven't done, to isolate the issue:

    Review for any auto-scaling rules or health check configurations. Checkout this doc: Best practices for autoscale

    If your application relies on other services or databases, ensure that they are not experiencing issues or performing maintenance tasks at the same times.

    To isolate the issue, you may leverage App Service diagnostics from Azure Portal> Navigate to your App Service app in the Azure Portal.

    In the left navigation, click on Diagnose and solve problems - Review - “Configuration and Management and “Availability and Performance” 

    Enable and review logs to fetch more details about the error: #enable-application-logging-linuxcontainer and Access log files


1 additional answer

Sort by: Most helpful
  1. Sedat SALMAN 14,065 Reputation points MVP
    2024-07-30T05:29:27.75+00:00

    Temporarily scale up your App Service plan to see if it resolves the issue

    and

    Integrate Application Insights for deeper monitoring and profiling of your application's performance.


Your answer

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