##[warning]Error: Failed to update deployment history. Error: Bad Gateway (CODE: 502).why this error occurs in app service?

Abitha Srini 0 Reputation points
2023-11-16T17:44:13.0066667+00:00

User's image

Hi,

This error often comes in my azure webapp for containers. Can I please know the reason for this error and how can I solve it?

Thanks,

Abitha

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

1 answer

Sort by: Most helpful
  1. Grmacjon-MSFT 12,966 Reputation points
    2023-11-21T07:56:17.7366667+00:00

    Hello @Abitha Srini We are sorry to hear you're facing this issue. when did you start noticing this issue?

    The “Bad Gateway” error (502) you’re encountering in your Azure WebApp for Containers could mean that there’s a problem with the network communication between the gateway (or proxy) and the servers

    Here are a few potential causes and solutions:

    1. Network Security Group, User Defined Route, or Custom DNS issue: If access to the backend is blocked because of an NSG, UDR, or custom DNS, application gateway instances can’t reach the backend pool. This issue causes probe failures, resulting in 502 errors. You can validate NSG, UDR, and DNS configuration by checking NSGs associated with the application gateway subnet, UDR associated with the application gateway subnet, and presence of custom DNS in the VNet
    2. Application Level Issues: This problem is often caused by application level issues, such as requests taking a long time, application using high memory/CPU, application crashing due to an exception
    3. Exceeding the Maximum TCP Connections: There’s a chance you’re exceeding the maximum TCP connections for the plan

    To troubleshoot these errors, you can use the diagnostics tool provided by App Service, which provides an intelligent and interactive experience to help you troubleshoot your app with no configuration required. You can also use the Kudu Debug Console for debugging, exploring, uploading files, as well as JSON endpoints for getting information about your environment

    Hope that helps.

    -Grace

    0 comments No comments