Skip to content

Commit 95f98ec

Browse files
Merge pull request #297231 from TimShererWithAquent/us411174-02
AI Freshness Edit: Azure App Services: "Troubleshoot HTTP 502 and 503..."
2 parents 22ea467 + 69e1a30 commit 95f98ec

File tree

3 files changed

+36
-28
lines changed

3 files changed

+36
-28
lines changed
19.4 KB
Loading
6.73 KB
Loading

articles/app-service/troubleshoot-http-502-http-503.md

Lines changed: 36 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,62 +6,66 @@ keywords: 502 bad gateway, 503 service unavailable, error 503, error 502
66

77
ms.assetid: 51cd331a-a3fa-438f-90ef-385e755e50d5
88
ms.topic: troubleshooting-general
9-
ms.date: 07/06/2016
9+
ms.date: 03/31/2025
1010
ms.author: msangapu
1111
author: msangapu-msft
12+
#customer intent: As an app developer, I need to troubleshoot common errors if they occur using tools provided by Azure App Service.
1213
---
1314

1415
# Troubleshoot HTTP 502 and 503 errors in Azure App Service
1516

16-
HTTP "502 Bad Gateway" and "503 Service Unavailable" are common errors that you can get when you try to open your app that's hosted in [Azure App Service](./overview.md). This article helps you troubleshoot these errors.
17+
HTTP "502 Bad Gateway" and "503 Service Unavailable" are common errors that you can get when you open an app that you host in [Azure App Service](./overview.md). This article helps you troubleshoot these errors.
1718

18-
If you need more help at any point in this article, you can contact the Azure experts on [the MSDN Azure and Stack Overflow forums](https://azure.microsoft.com/support/forums/). Alternatively, you can file an Azure support incident on the [Azure Support site](https://azure.microsoft.com/support/options/) by selecting **Get Support**.
19+
If you need more help, you can contact the Azure experts at [Azure Community Support](https://azure.microsoft.com/support/forums/). Or, you can use resources at the [Azure Support site](https://azure.microsoft.com/support/options/).
1920

2021
The cause of these errors is often an application-level problem, such as:
2122

22-
* Requests are taking a long time.
23-
* The app is using high memory or CPU.
24-
* An exception is preventing the app from responding.
23+
- Requests are taking a long time.
24+
- The app is using high memory or CPU.
25+
- An exception is preventing the app from responding.
2526

2627
Troubleshooting consists of three tasks, in sequential order:
2728

2829
1. Observe and monitor application behavior.
29-
2. Collect data.
30-
3. Mitigate the problem.
30+
1. Collect data.
31+
1. Mitigate the problem.
3132

3233
App Service gives you options for each task.
3334

3435
<a name="observe"></a>
3536

3637
## Observe and monitor application behavior
3738

39+
Azure App Service provides several ways to observe app behavior.
40+
3841
### Track service health
3942

4043
Azure publicizes service interruptions and performance degradations in App Service. You can track the health of the service in the [Azure portal](https://portal.azure.com/). For more information, see [View service health notifications by using the Azure portal](/azure/service-health/service-notifications).
4144

4245
### Monitor your app
4346

44-
You can monitor your app to find out if it's having any problems. On the Azure portal page for your app, select the **Requests and errors** tile. The **Metric** box shows you all the metrics that you can add.
47+
You can monitor your app to find out if it's having any problems. On the Azure portal page for your app, select **Monitoring** > **Metrics**. The **Metric** dropdown menu shows you the metrics that you can add.
4548

4649
Some of the metrics that you might want to monitor for your app are:
4750

48-
* Average memory working set
49-
* Average response time
50-
* CPU time
51-
* Memory working set
52-
* Requests
51+
- Average memory working set
52+
- CPU time
53+
- Memory working set
54+
- Requests
5355

54-
:::image type="content" source="./media/app-service-web-troubleshoot-HTTP-502-503/1-monitor-metrics.png" alt-text="Screenshot that shows metric options for an app in the portal.":::
56+
:::image type="content" source="./media/app-service-web-troubleshoot-HTTP-502-503/1-monitor-metrics.png" alt-text="Screenshot that shows metric options for an app in the portal." lightbox="./media/app-service-web-troubleshoot-HTTP-502-503/1-monitor-metrics.png":::
5557

5658
For more information, see:
5759

58-
* [Azure App Service quotas and metrics](web-sites-monitor.md)
59-
* [What are Azure Monitor alerts?](/azure/azure-monitor/alerts/alerts-overview)
60+
- [Azure App Service quotas and metrics](web-sites-monitor.md)
61+
- [What are Azure Monitor alerts?](/azure/azure-monitor/alerts/alerts-overview)
6062

6163
<a name="collect"></a>
6264

6365
## Collect data
6466

67+
Collect data by using diagnostics or the Kudu debug console.
68+
6569
### Use the diagnostics feature
6670

6771
App Service provides an intelligent and interactive experience to help you troubleshoot your app, with no configuration required. The diagnostics feature can discover a problem and guide you to the right information for troubleshooting and resolution.
@@ -72,16 +76,18 @@ To access App Service diagnostics, go to your App Service app or App Service Env
7276

7377
App Service comes with a console that you can use for debugging, exploring, and uploading files. It also provides JSON endpoints that you can use to get information about your environment. This console is part of the Kudu dashboard for your app.
7478

75-
You can access the dashboard by going to the link `https://<Your app name>.scm.azurewebsites.net/`.
79+
In the Azure portal, go to your app. In the left menu, select **Development Tools** > **Advanced Tools**. Select **Go** to open Kudu in a new browser window.
80+
81+
By default, your app domain includes these elements: `<app-name>`-`<random-hash>`.`<region>`. You can also access the dashboard by going to the link `https://<app-name>-<random-hash>.scm.<region>.azurewebsites.net/`. To get the random hash and region values, in your app **Overview**, copy **Default domain**.
7682

7783
Kudu provides:
7884

79-
* Environment settings for your application.
80-
* A log stream.
81-
* A diagnostic dump.
82-
* The debug console, in which you can run PowerShell cmdlets and basic DOS commands.
85+
- Environment settings for your application.
86+
- A log stream.
87+
- A diagnostic dump.
88+
- The debug console, in which you can run PowerShell cmdlets and basic DOS commands.
8389

84-
If your application is throwing first-chance exceptions, you can use Kudu and the Sysinternals tool ProcDump to create memory dumps. These memory dumps are snapshots of the process and can often help you troubleshoot more complicated problems with your app.
90+
If your application is throwing first-chance exceptions, you can use Kudu and the Sysinternals tool ProcDump to create memory dumps. These memory dumps are snapshots of the process and can help you troubleshoot more complicated problems with your app.
8591

8692
For more information on features available in Kudu, see the blog post
8793
[Kudu Dashboard explained - WordPress on App Service](https://techcommunity.microsoft.com/blog/appsonazureblog/kudu-dashboard-explained---wordpress-on-app-service/4030035).
@@ -90,30 +96,32 @@ For more information on features available in Kudu, see the blog post
9096

9197
## Mitigate the problem
9298

99+
Consider these options to address these issues.
100+
93101
### Scale the app
94102

95103
In Azure App Service, for increased performance and throughput, you can adjust the scale at which you run your application. Scaling up an app involves two related actions:
96104

97-
* Changing your App Service plan to a higher pricing tier
98-
* Configuring certain settings after you switch to a higher pricing tier
105+
- Changing your App Service plan to a higher pricing tier
106+
- Configuring certain settings after you switch to a higher pricing tier
99107

100108
For more information on scaling, see [Scale an app in Azure App Service](manage-scale-up.md).
101109

102-
Additionally, you can choose to run your application on more than one instance. This choice not only provides you with more processing capability but also gives you some amount of fault tolerance. If the process goes down on one instance, the other instance continues to serve requests.
110+
You can also choose to run your application on more than one instance. This choice provides you with more processing capability and also gives you some fault tolerance. If the process goes down on one instance, the other instance continues to serve requests.
103111

104112
You can set the scaling to be manual or automatic.
105113

106114
### Use auto-healing
107115

108116
Auto-healing recycles the worker process for your app based on settings that you choose. The settings include configuration changes, requests, memory-based limits, or the time needed to execute a request.
109117

110-
Most of the time, recycling the process is the fastest way to recover from a problem. Though you can always restart the app directly in the Azure portal, auto-healing can do it automatically for you. All you need to do is add some triggers in the root `Web.config` file for your app. These settings work in the same way even if your application is not a .NET one.
118+
Most of the time, recycling the process is the fastest way to recover from a problem. Though you can always restart the app directly in the Azure portal, auto-healing can do it automatically for you. All you need to do is add some triggers in the root `Web.config` file for your app. These settings work in the same way even if your application isn't a .NET one.
111119

112120
For more information, see [Azure App Service diagnostics overview](overview-diagnostics.md#auto-healing).
113121

114122
### Restart the app
115123

116-
Restarting your app is often the simplest way to recover from one-time problems. On the [Azure portal](https://portal.azure.com/) page for your app, you have the option to stop or restart your app.
124+
Restarting your app is often the simplest way to recover from one-time problems. On the [Azure portal](https://portal.azure.com/) page for your app, you can stop or restart your app.
117125

118126
:::image type="content" source="./media/app-service-web-troubleshoot-HTTP-502-503/2-restart.png" alt-text="Screenshot that shows options for stopping and restarting an app in the portal.":::
119127

0 commit comments

Comments
 (0)