You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> Automatic scaling is available for all app types: Windows and Linux (deploy as code and container). Automatic scaling isn't supported for deployment slot traffic.
16
16
>
17
17
18
-
Automatic scaling is a new scale-out option that automatically handles scaling decisions for your web apps and App Service plans. It's different from the preexisting **[Azure autoscale](/azure/azure-monitor/autoscale/autoscale-overview)**, which lets you define scaling rules based on schedules and resources. With automatic scaling, you can adjust scaling settings to improve your app's performance and avoid cold start issues. The platform prewarms instances to act as a buffer when scaling out, ensuring smooth performance transitions. You're charged per second for every instance, including prewarmed instances.
18
+
Automatic scaling is a scale-out option that automatically handles scaling decisions for your web apps and App Service plans. It's different from **[Azure autoscale](/azure/azure-monitor/autoscale/autoscale-overview)**, which lets you define scaling rules based on schedules and resources.
19
+
20
+
With automatic scaling, you can adjust scaling settings to improve your app's performance and avoid cold start issues. The platform prewarms instances to act as a buffer when scaling out, ensuring smooth performance transitions. You're charged per second for every instance, including prewarmed instances.
19
21
20
22
The following table compares scale-out and scale-in options available on App Service:
21
23
22
24
||**Manual**|**Autoscale**|**Automatic scaling**|
23
25
| --- | --- | --- | --- |
24
-
| Available pricing tiers| Basic and up.| Standard and up.| Premium V2 (P1V2, P2V2 and P3V2) pricing tiers. Premium V3 (P0V3, P1V3, P2V3, P3V3, P1MV3, P2MV3, P3MV3, P4MV3 and P5MV3) pricing tiers.|
25
-
|Rule-based scaling|No. |Yes|No, the platform manages out the scale and scalein based on HTTP traffic. |
26
-
|Schedule-based scaling|No. |Yes. |No.|
27
-
|Always-ready instances | No, your web app runs on the number of manually scaled instances.| No, your web app runs on other instances available during the scale-out operation, based on the threshold defined for autoscale rules. | Yes (minimum 1).|
28
-
|Prewarmed instances|No. |No. |Yes (default 1).|
29
-
|Per-app maximum|No. |No. |Yes.|
26
+
| Available pricing tiers| Basic and up | Standard and up | Premium V2 (P1V2, P2V2, and P3V2) pricing tiers. Premium V3 (P0V3, P1V3, P2V3, P3V3, P1MV3, P2MV3, P3MV3, P4MV3, and P5MV3) pricing tiers.|
27
+
|Rule-based scaling|No|Yes|No, the platform manages the scale-out and scale-in based on HTTP traffic. |
28
+
|Schedule-based scaling|No|Yes|No|
29
+
|Always-ready instances | No, your web app runs on the number of manually scaled instances.| No, your web app runs on other instances available during the scale-out operation, based on the threshold defined for autoscale rules. | Yes (minimum 1) |
30
+
|Prewarmed instances|No|No|Yes (default 1) |
31
+
|Per-app maximum|No|No|Yes|
30
32
31
33
## How automatic scaling works
32
34
@@ -40,11 +42,11 @@ Here are a few scenarios where you should scale out automatically:
40
42
41
43
## Enable automatic scaling
42
44
43
-
The **Maximum burst**level represents the highest number of instances that your App Service plan can increase to based on incoming HTTP requests. For Premium v2 & v3 plans, you can set **Maximum burst** to up to 30 instances. The **Maximum burst** number must be equal to or greater than the number of workers specified for the App Service plan.
45
+
The **Maximum burst**setting represents the highest number of instances that your App Service plan can increase to based on incoming HTTP requests. For Premium v2 & v3 plans, you can specify up to 30 instances. The maximum burst number must be equal to or greater than the number of workers specified for the App Service plan.
44
46
45
47
#### [Azure portal](#tab/azure-portal)
46
48
47
-
To enable automatic scaling, go to the web app's left menu and select **scale-out (App Service Plan)**. Select **Automatic**, update the **Maximum burst** value, and select the **Save** button.
49
+
To enable automatic scaling, go to the web app's left menu. Under **Settings**, select **Scale-out (App Service plan)**. Select **Automatic**, update the **Maximum burst** value, and select the **Save** button.
48
50
49
51
:::image type="content" source="./media/manage-automatic-scaling/azure-portal-automatic-scaling.png" alt-text="Screenshot that shows automatic scaling in Azure portal" :::
50
52
@@ -57,7 +59,7 @@ az appservice plan update --name <APP_SERVICE_PLAN> --resource-group <RESOURCE_G
57
59
```
58
60
59
61
>[!NOTE]
60
-
> If you receive the error message "Operation returned an invalid status 'Bad Request'," try using a different resource group or create a new one.
62
+
> If you receive the error message `Operation returned an invalid status 'Bad Request'`, try using a different resource group or create a new one.
61
63
>
62
64
63
65
---
@@ -68,11 +70,14 @@ The app-level setting **Always ready instances** specifies the minimum number of
68
70
69
71
#### [Azure portal](#tab/azure-portal)
70
72
71
-
To set the minimum number of web app instances, go to the web app's left menu and select **scale-out (App Service Plan)**. Update the **Always ready instances** value, and select the **Save** button.
73
+
To set the minimum number of web app instances, go to the web app's left menu and select **Scale-out (App Service plan)**. Update the **Always ready instances** value, and select the **Save** button.
72
74
73
75
:::image type="content" source="./media/manage-automatic-scaling/azure-portal-always-ready-instances.png" alt-text="Screenshot of always-ready instances." :::
74
76
75
77
#### [Azure CLI](#tab/azure-cli)
78
+
79
+
To set the minimum number of web app instances, use the following command:
80
+
76
81
```azurecli-interactive
77
82
az webapp update --resource-group <RESOURCE_GROUP> --name <APP_NAME> --minimum-elastic-instance-count <ALWAYS_READY_COUNT>
78
83
```
@@ -81,11 +86,11 @@ To set the minimum number of web app instances, go to the web app's left menu an
81
86
82
87
## Set the maximum number of web app instances
83
88
84
-
The **Maximum scale limit** value sets the maximum number of instances a web app can scale to. The **Maximum scale limit** is helpful when a downstream component like a database has limited throughput. The per-app maximum can be between 1 and the **Maximum burst**.
89
+
The **Maximum scale limit** value sets the maximum number of instances a web app can scale to. The **Maximum scale limit** is helpful when a downstream component like a database has limited throughput. The per-app maximum can be between 1 and the maximum burst value.
85
90
86
91
#### [Azure portal](#tab/azure-portal)
87
92
88
-
To set the maximum number of web app instances, go to the web app's left menu and select **scale-out (App Service Plan)**. Select **Enforce scale-out limit**, update the **Maximum scale limit**, and select the **Save** button.
93
+
To set the maximum number of web app instances, go to the web app's left menu and select **Scale-out (App Service plan)**. Select **Enforce scale-out limit**, update the **Maximum scale limit**, and select the **Save** button.
89
94
90
95
:::image type="content" source="./media/manage-automatic-scaling/azure-portal-maximum-scale-limit.png" alt-text="Screenshot of maximum scale limit." :::
91
96
@@ -97,7 +102,7 @@ Currently, you can't change the **Maximum scale limit** in the Azure CLI. You mu
97
102
98
103
## Update prewarmed instances
99
104
100
-
The **prewarmed instance** setting provides warmed instances as a buffer during HTTP scale and activation events. Prewarmed instances continue to buffer until the maximum scale-out limit is reached. The default **prewarmed instance** count is 1 and, for most scenarios, this value should remain as 1.
105
+
The prewarmed instance setting provides warmed instances as a buffer during HTTP scale and activation events. Prewarmed instances continue to buffer until the maximum scale-out limit is reached. The default prewarmed instance count is *1* and, for most scenarios, this value should remain as 1.
101
106
102
107
#### [Azure portal](#tab/azure-portal)
103
108
@@ -117,7 +122,7 @@ You can modify the number of prewarmed instances for an app by using the Azure C
117
122
118
123
#### [Azure portal](#tab/azure-portal)
119
124
120
-
To disable automatic scaling, go to the web app's left menu and select **scale-out (App Service Plan)**. Select **Manual** and select the **Save** button.
125
+
To disable automatic scaling, go to the web app's left menu and select **Scale-out (App Service plan)**. Select **Manual** and select the **Save** button.
121
126
122
127
:::image type="content" source="./media/manage-automatic-scaling/azure-portal-manual-scaling.png" alt-text="Screenshot of manual scaling." :::
123
128
@@ -141,6 +146,7 @@ No, you can only have Azure App Service web apps in the App Service plan in whic
141
146
>
142
147
143
148
### How does automatic scaling work behind the scenes?
149
+
144
150
Applications set to automatically scale are continuously monitored, with worker health assessments occurring at least once every few seconds. If the system detects increased load on the application, health checks become more frequent. If worker health deteriorates and requests slow down, other instances are requested. The speed at which instances are added varies based on the individual application's load pattern and startup time. Applications with brief startup times and intermittent bursts of load might see one virtual machine added every few seconds to a minute.
145
151
146
152
Once the load subsides, the platform initiates a review for potential scaling in. This process typically begins about 5-10 minutes after the load stops increasing. During scaling in, instances are removed at a maximum rate of one every few seconds to a minute.
@@ -168,11 +174,12 @@ If your web app returns a 5xx status, these endpoint pings might result in inter
168
174
### How do I track the number of scaled-out instances during the automatic scaling event?
169
175
170
176
The `AutomaticScalingInstanceCount` metric reports the number of virtual machines on which the app is running, including the prewarmed instance if it's deployed. This metric can also be used to track the maximum number of instances your web app scaled out during an automatic scaling event. This metric is available only for the apps that have **Automatic Scaling** enabled.
177
+
171
178
### How does ARR Affinity affect automatic scaling?
172
179
173
180
Azure App Service uses Application Request Routing cookies known as an ARR Affinity. ARR Affinity cookies restrict scaling because they send requests only to servers associated with the cookie, rather than any available instance. For apps that store state, it's better to scale up (increase resources on a single instance). For stateless apps, scaling out (adding more instances) offers more flexibility and scalability. ARR Affinity cookies are enabled by default on App Service. Depending on your application needs, you might choose to disable ARR affinity cookies when using automatic scaling.
174
181
175
-
To disable ARR Affinity cookies: select your App Service app, and under **Settings**, select **Configuration**. Next select the **General settings** tab. Under **ARR affinity**, select **Off** and then select the **Save** button.
182
+
To disable ARR Affinity cookies: select your App Service app, and under **Settings**, select **Configuration**. Next select the **General settings** tab. Under **Session affinity**, select **Off** and then select the **Save** button.
Copy file name to clipboardExpand all lines: articles/app-service/monitor-app-service.md
+13-13Lines changed: 13 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Monitor Azure App Service
3
-
description: Start here to learn how to monitor Azure App Service.
4
-
ms.date: 03/05/2024
3
+
description: Learn about options in Azure App Service for monitoring resources for availability, performance, and operation.
4
+
ms.date: 04/18/2025
5
5
ms.custom: horz-monitor
6
6
ms.topic: conceptual
7
7
author: msangapu-msft
@@ -15,7 +15,7 @@ ms.service: azure-app-service
15
15
16
16
## App Service monitoring
17
17
18
-
Azure App Service provides several monitoring options for monitoring resources for availability, performance, and operation. Options include Diagnostic Settings, Application Insights, log stream, metrics, quotas and alerts, and activity logs.
18
+
Azure App Service provides several options for monitoring resources for availability, performance, and operation. Options include diagnostic settings, Application Insights, log stream, metrics, quotas and alerts, and activity logs.
19
19
20
20
On the Azure portal page for your web app, you can select **Diagnose and solve problems** from the left navigation to access complete App Service diagnostics for your app. For more information about the App Service diagnostics tool, see [Azure App Service diagnostics overview](overview-diagnostics.md).
21
21
@@ -55,7 +55,7 @@ For more information about the resource types for App Service, see [App Service
For a list of available metrics for App Service, see [App Service monitoring data reference](monitor-app-service-reference.md#metrics).
57
57
58
-
For help understanding metrics in App Service, see [Understand metrics](web-sites-monitor.md#understand-metrics). Metrics can be viewed by aggregates on data (ie. average, max, min, etc.), instances, time range, and other filters. Metrics can monitor performance, memory, CPU, and other attributes.
58
+
For help understanding metrics in App Service, see [Metrics](web-sites-monitor.md#understand-metrics). Metrics can be viewed by aggregates on data (such as average, max, min), instances, time range, and other filters. Metrics can monitor performance, memory, CPU, and other attributes.
For the available resource log categories, their associated Log Analytics tables, and the logs schemas for App Service, see [App Service monitoring data reference](monitor-app-service-reference.md#resource-logs).
@@ -69,7 +69,7 @@ For the available resource log categories, their associated Log Analytics tables
69
69
70
70
Azure activity logs for App Service include details such as:
71
71
72
-
- What operations were taken on the resources (ex: App Service Plans)
72
+
- What operations were taken on the resources (for example, App Service plans)
73
73
- Who started the operation
74
74
- When the operation occurred
75
75
- Status of the operation
@@ -130,7 +130,7 @@ See [Azure Monitor queries for App Service](https://github.com/microsoft/AzureMo
130
130
131
131
### Quotas and alerts
132
132
133
-
Apps that are hosted in App Service are subject to certain limits on the resources they can use. [The limits](web-sites-monitor.md#understand-quotas) are defined by the App Service plan that's associated with the app. Metrics for an app or an App Service plan can be hooked up to alerts.
133
+
Apps that are hosted in App Service are subject to certain limits on the resources they can use. The limits are defined by the App Service plan that's associated with the app. Metrics for an app or an App Service plan can be hooked up to alerts. To learn more, see [Quotas](web-sites-monitor.md#understand-quotas).
134
134
135
135
### App Service alert rules
136
136
@@ -140,15 +140,15 @@ The following table lists common and recommended alert rules for App Service.
140
140
|:---|:---|:---|
141
141
| Metric | Average connections| When number of connections exceed a set value|
142
142
| Metric | HTTP 404| When HTTP 404 responses exceed a set value|
143
-
| Metric | HTTP Server Errors| When HTTP 5xx errors exceed a set value|
144
-
| Activity Log| Create or Update Web App| When app is created or updated|
145
-
| Activity Log| Delete Web App| When app is deleted|
146
-
| Activity Log| Restart Web App| When app is restarted|
147
-
| Activity Log| Stop Web App| When app is stopped|
143
+
| Metric | HTTP server errors| When HTTP 5xx errors exceed a set value|
144
+
| Activity log| Create or update web app| When app is created or updated|
145
+
| Activity log| Delete web app| When app is deleted|
146
+
| Activity log| Restart web app| When app is restarted|
147
+
| Activity log| Stop web app| When app is stopped|
-See [App Service monitoring data reference](monitor-app-service-reference.md) for a reference of the metrics, logs, and other important values created for App Service.
154
-
-See [Monitoring Azure resources with Azure Monitor](/azure/azure-monitor/essentials/monitor-azure-resource) for general details on monitoring Azure resources.
153
+
-[Azure App Service monitoring data reference](monitor-app-service-reference.md)
154
+
-[Monitor Azure resources with Azure Monitor](/azure/azure-monitor/essentials/monitor-azure-resource)
0 commit comments