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
@@ -17,7 +17,7 @@ This article describes reliability support in [Azure App Service](../app-service
17
17
18
18
Azure App Service is an HTTP-based service for hosting web applications, REST APIs, and mobile back ends. Azure App Service adds the power of Microsoft Azure to your application, with capabilities for security, load balancing, autoscaling, and automated management. To explore how Azure App Service can bolster the reliability and resiliency of your application workload, see [App Service overview](../app-service/overview.md)
19
19
20
-
When you deploy Azure App Service, you can create multiple instances of an *App Service plan*, which represents the compute workers that run your application code. For more information, see [Azure App Service plan](/azure/app-service/overview-hosting-plans). Although the platform makes an effort to deploy the instances across different fault domains, it doesn't automatically spread the instances across availability zones.
20
+
When you deploy Azure App Service, you can provision multiple instances in an *App Service plan*, which represents the compute workers that run your application code. For more information, see [Azure App Service plan](/azure/app-service/overview-hosting-plans). Although the platform makes an effort to deploy the instances across different fault domains, it doesn't automatically spread the instances across availability zones.
21
21
22
22
## Production deployment recommendations
23
23
@@ -57,20 +57,27 @@ Azure App Service can be configured as *zone redundant*, which means that your r
57
57
Instance spreading with a zone-redundant deployment is determined using the following rules. These rules apply even as the app scales in and out:
58
58
59
59
- The minimum App Service plan instance count is two.
60
-
- Instances are spread across multiple availability zones automatically when zone redundancy is enabled. The number of availability zones used by your plan is determined by Azure. To view the number of availability zones used by your plan, see the *MaximumNumberOfZones* property on the serverfarm object or see the value in the **Scale out (App Service plan)** blade in the Azure portal. This property is a ReadOnly property. If the *MaxumumNumberOfZones* value is 2 or 3, your App Service plan can be zone redundant. If this value is 1, your App Service plan doesn't support zone redundancy.
60
+
- Instances are spread across multiple availability zones automatically when zone redundancy is enabled. The number of availability zones used by your plan is determined by Azure. To view the number of availability zones used by your plan, see the *maximumNumberOfZones* property on the App Service plan. This property is a ReadOnly property. If the *maxumumNumberOfZones* value is 2 or 3, your App Service plan can be zone redundant. If this value is 1, your App Service plan doesn't support zone redundancy.
61
61
62
-
:::image type="content" source="media/reliability-app-service/app-service-plan-max-zones-portal.png" alt-text="Screenshot of the App Service plan scale out blade in the Azure portal showing the MaximumNumberOfZones property." border="false":::
62
+
```azurecli
63
+
az appservice plan show -n <app-service-plan-name> -g <resource-group-name> --query properties.maximumNumberOfZones
64
+
```
65
+
<!-- - Instances are spread across multiple availability zones automatically when zone redundancy is enabled. The number of availability zones used by your plan is determined by Azure. To view the number of availability zones used by your plan, see the *MaximumNumberOfZones* property on the App Service plan or see the value in the **Scale out (App Service plan)** blade in the Azure portal. This property is a ReadOnly property. If the *MaxumumNumberOfZones* value is 2 or 3, your App Service plan can be zone redundant. If this value is 1, your App Service plan doesn't support zone redundancy.
66
+
67
+
:::image type="content" source="media/reliability-app-service/app-service-plan-max-zones-portal.png" alt-text="Screenshot of the App Service plan scale out blade in the Azure portal showing the MaximumNumberOfZones property." border="false"::: -->
63
68
64
69
- The instances spread evenly if you specify a capacity larger than two, and the number of instances is divisible by two.
65
70
- Any instance counts beyond 2*N are spread across the remaining one or two zones.
66
71
72
+
To view the physical zone placement of your App Service plan instances, use the [REST API](/rest/api/appservice/web-apps/get-instance-info) and see the `physicalZone` value for each instance.
67
73
68
-
To view the physical zone placement of your App Service plan instances, go to the App Service plan **Instances** blade in Azure portal or use the [REST API](/rest/api/appservice/web-apps/get-instance-info).
74
+
```azurecli
75
+
az rest --method get --url https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Web/sites/{appName}/instances?api-version=2024-04-01
76
+
```
69
77
70
-
<!--TODO: add image when portal is ready-->
78
+
<!--To view the physical zone placement of your App Service plan instances, in the Azure portal go to the App Service **Health check** blade and select the **Instances** tab for one of your web apps in a given App Service plan or use the [REST API](/rest/api/appservice/web-apps/get-instance-info).-->
71
79
72
-
> [!NOTE]
73
-
> In some cases, your workload is hosted on a scale unit (also known as a stamp, or a compute cluster) that's deployed across two availability zones rather than three zones. For these cases, the instances are evenly spread across the two zones if the number of instances is divisible by two. Any instance count beyond 2*n is placed in one of the zones.
80
+
<!-- TODO: add image when portal is ready -->
74
81
75
82
When the App Service platform allocates instances for a zone-redundant App Service plan, it uses best effort zone balancing offered by the underlying Azure virtual machine scale sets. An App Service plan is *balanced* if each zone has either the same number of virtual machines, or plus or minus one, in all of the other zones. For more information, see [Zone balancing](/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-use-availability-zones#zone-balancing).
76
83
@@ -110,9 +117,15 @@ You must use the [Premium v2, Premium v3, or Isolated v2 plan types](/azure/app-
110
117
111
118
- Availability zones are supported only on newer App Service scale units. Even if you're using one of the supported regions, if availability zones aren't supported for the scale unit you use then you receive an error when creating a zone-redundant App Service plan.
112
119
113
-
The scale units you're assigned to is based on the resource group you deploy an App Service plan to. To ensure that your workloads land on a scale unit that supports availability zones, you might need to create a new resource group and then create a new App Service plan and App Service app within the new resource group.
120
+
The scale unit you're assigned to is based on the resource group you deploy an App Service plan to. To ensure that your workloads land on a scale unit that supports availability zones, you might need to create a new resource group and then create a new App Service plan and App Service app within the new resource group.
121
+
122
+
To see if your App Service plan is on a stamp that supports availability zones, check the `maximumNumberOfZones` property for the App Service plan. If the value is greater than 1, your stamp supports zones and you can be zone-redundant. If the value is equal to 1, your scale unit doesn't have availability zones.
114
123
115
-
To see if your App Service plan is on a stamp that supports availability zones, go to the **Scale out (App Service plan)** blade of your App Service plan in the Azure portal and check the `Maximum available zones` property. If the value is greater than 1, your stamp supports zones and you can be zone-redundant. If the value is equal to 1, your scale unit doesn't have availability zones.
124
+
```azurecli
125
+
az appservice plan show -n <app-service-plan-name> -g <resource-group-name> --query properties.maximumNumberOfZones
126
+
```
127
+
128
+
<!-- To see if your App Service plan is on a stamp that supports availability zones, go to the **Scale out (App Service plan)** blade of your App Service plan in the Azure portal and check the `Maximum available zones` property. If the value is greater than 1, your stamp supports zones and you can be zone-redundant. If the value is equal to 1, your scale unit doesn't have availability zones. -->
116
129
117
130
- You must deploy a minimum of two instances in your plan.
118
131
@@ -154,40 +167,152 @@ If you enable availability zones but specify a capacity less than two, the platf
154
167
155
168
::: zone pivot="premium"
156
169
157
-
-**Create a new App Service plan with zone redundancy.** To deploy a new zone-redundant Azure App Service plan, select the *Zone redundant* option when you deploy the plan or enable the App Service plan `zoneRedundant` property to `true` in your ARM/Bicep template.
158
-
-**Migration.** If you have an existing App Service plan that supports zone-redundancy (the maximum available zones is greater than 1), you can enable zone redundancy b either setting the App Service plan `-zoneRedundant` property to `true` or selecting the box in the Azure portal.
170
+
- **Create a new App Service plan with zone redundancy.** To deploy a new zone-redundant Azure App Service plan, select the *Zone redundant* option when you deploy the plan in the Azure portal or set the App Service plan `zoneRedundant` property to `true` in your ARM/Bicep template.
az appservice plan create -g MyResourceGroup -n MyPlan --zone-redundant --number-of-workers 2 --sku P1V3
190
+
```
191
+
192
+
<!-- - **Migration.** If you have an existing App Service plan that supports zone-redundancy (the maximum available zones is greater than 1), you can enable zone redundancy by either setting the App Service plan `zoneRedundant` property to `true` or selecting the box in the Azure portal. -->
193
+
- **Migration.** If you have an existing App Service plan that supports zone-redundancy (the maximum available zones is greater than 1), you can enable zone redundancy by setting the App Service plan `zoneRedundant` property to `true` in ARM/Bicep or with the Azure CLI.
194
+
195
+
```azurecli
196
+
az appservice plan update -g <resource group name> -n <app service plan name> --set zoneRedundant=true sku.capacity=2
197
+
```
198
+
199
+
> [!NOTE]
200
+
> If you use the Azure CLI to modify the zone redundant property, you must specify the capacity (number of instances) and use a capacity greater than or equal to 2 if you need to enable the property. If you don't specify the capacity, the value defaults to 1. If you want to disable the property, you should also specify the capacity, otherwise it defaults to 1.
159
201
160
-
>[IMPORTANT]
161
-
> If you are on a plan or a stamp that doesn't support availability zones (the maximum number of zones is 1), you must create a new App Service plan in a new resource group so that you land on the App Service footprint that supports zones.
202
+
If you're on a plan or a stamp that doesn't support availability zones (the maximum number of zones is 1), you must create a new App Service plan in a new resource group so that you land on the App Service footprint that supports zones.
162
203
163
-
:::image type="content" source="media/reliability-app-service/app-service-plan-zone-redundancy-portal.png" alt-text="Screenshot of the App Service plan scale out blade in the Azure portal showing the zone redundant property to enable zone redundancy." border="false":::
204
+
<!-- :::image type="content" source="media/reliability-app-service/app-service-plan-zone-redundancy-portal.png" alt-text="Screenshot of the App Service plan scale out blade in the Azure portal showing the zone redundant property to enable zone redundancy." border="false"::: -->
164
205
165
206
> [!NOTE]
166
207
> Changing the zone redundancy status of an App Service plan is almost instaneous. You don't experience downtime or performance issues during the process.
167
208
168
-
-**Disable zone redundancy.** To disable zone redundancy, you can set the App Service plan `zoneRedundant` property to `false` or disable using the Azure portal.
209
+
- **Disable zone redundancy.** To disable zone redundancy, you can set the App Service plan `zoneRedundant` property to `false` or use the Azure CLI.
210
+
211
+
```azurecli
212
+
az appservice plan update -g <resource group name> -n <app service plan name> --set zoneRedundant=false sku.capacity=1
213
+
```
214
+
<!-- - **Disable zone redundancy.** To disable zone redundancy, you can set the App Service plan `zoneRedundant` property to `false` or disable using the Azure portal. -->
169
215
170
216
::: zone-end
171
217
172
218
::: zone pivot="isolated"
173
219
174
220
- **Create a new App Service plan with zone redundancy.** To deploy a new zone-redundant Azure App Service Environment, see [Create an App Service Environment](/azure/app-service/environment/creation).
221
+
175
222
To create a new zone-redundant App Service plan in an existing App Service Environment:
176
223
177
224
1. Ensure that the App Service Environment has zone redundancy enabled. You can only enable zone redundancy on an Isolated v2 App Service plan when the App Service Environment is zone redundant.
178
-
2. On the App Service Environment, select the *Zone redundant* option when you deploy the plan or set the App Service plan `zoneRedundant` property to `true` in your ARM/Bicep template.
179
-
-**Migration.** If you have an existing App Service Environment or Isolated v2 App Service plan that supports zone-redundancy (the maximum available zones is greather than 1), you can enable zone redundancy at any time. To enable zone redundancy for the App Service Environment, set the `zoneRedundant` property to `true` or select the box in the Azure portal on the App Service Environment **Configuration** blade.
180
-
181
-
<!-- TODO: add image for ZR prop for ASE in configuration blade -->
182
-
183
-
For Isolated v2 App Service plans, if the App Service Environment is zone redundant, the App Service plans can be made zone redundant. Each App Service plan has its own independent zone redundancy setting, which means that you can have a mix of zone redundant and non-zone redundant plans in an App Service Environment. To enable zone redundancy on an Isolated v2 App Service plan, set the App Service plan's `-zoneRedundant` property to `true` or select the box in the Azure portal.
184
-
185
-
:::image type="content" source="media/reliability-app-service/app-service-plan-zone-redundancy-portal-isolated.png" alt-text="Screenshot of the Isolated v2 App Service plan scale out blade in the Azure portal showing the zone redundant property to enable zone redundancy." border="false":::
225
+
2. Select the *Zone redundant* option when you deploy the plan in the Azure portal or set the App Service plan `zoneRedundant` property to `true` in your ARM/Bicep template.
az appservice plan create -g MyResourceGroup -n MyPlan --app-service-environment MyAse --zone-redundant --number-of-workers 2 --sku I1V2
248
+
```
249
+
250
+
<!-- - **Migration.** If you have an existing App Service Environment or Isolated v2 App Service plan that supports zone-redundancy (the maximum available zones is greather than 1), you can enable zone redundancy at any time. To enable zone redundancy for the App Service Environment, set the `zoneRedundant` property to `true` or select the box in the Azure portal on the App Service Environment **Configuration** blade. -->
251
+
252
+
<!-- TODO: add image for ZR prop for ASE in configuration blade -->
253
+
- **Migration.** If you have an existing App Service Environment or Isolated v2 App Service plan that supports zone-redundancy (the maximum available zones is greater than 1), you can enable zone redundancy at any time.
254
+
255
+
To enable zone redundancy for the App Service Environment, set the `zoneRedundant` property to `true` or use the Azure CLI.
az resource update --ids /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Web/hostingEnvironments/{aseName} --set properties.zoneRedundant=true
274
+
```
186
275
187
276
> [!NOTE]
188
-
> When you change the zone redundancy status of the App Service Environment, you initiate an upgrade that takes 12-24 hours to complete. During the upgrade process, you won't experience any downtime or performance issues.
189
-
190
-
-**Disable zone redundancy.** To disable zone redundancy, you can set the App Service plan or App Service Environment `zoneRedundant` property to `false` or you can disable it in the Azure portal.
277
+
> When you change the zone redundancy status of the App Service Environment, you initiate an upgrade that takes 12-24 hours to complete. During the upgrade process, you don't experience any downtime or performance issues.
278
+
279
+
<!-- For Isolated v2 App Service plans, if the App Service Environment is zone redundant, the App Service plans can be made zone redundant. Each App Service plan has its own independent zone redundancy setting, which means that you can have a mix of zone redundant and non-zone redundant plans in an App Service Environment. To enable zone redundancy on an Isolated v2 App Service plan, set the App Service plan's `zoneRedundant` property to `true` or select the box in the Azure portal.
280
+
281
+
:::image type="content" source="media/reliability-app-service/app-service-plan-zone-redundancy-portal-isolated.png" alt-text="Screenshot of the Isolated v2 App Service plan scale out blade in the Azure portal showing the zone redundant property to enable zone redundancy." border="false"::: -->
282
+
283
+
For Isolated v2 App Service plans, if the App Service Environment is zone redundant, the App Service plans can be made zone redundant. Each App Service plan has its own independent zone redundancy setting, which means that you can have a mix of zone redundant and non-zone redundant plans in an App Service Environment. To enable zone redundancy on an Isolated v2 App Service plan, set the App Service plan's `zoneRedundant` property to `true` or use the Azure CLI.
az appservice plan update -g <resource group name> -n <app service plan name> --set zoneRedundant=true sku.capacity=2
306
+
```
307
+
308
+
- **Disable zone redundancy.** To disable zone redundancy, you can set the App Service plan or App Service Environment `zoneRedundant` property to `false` or use the Azure CLI.
309
+
310
+
```azurecli
311
+
az resource update --ids /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Web/hostingEnvironments/{aseName} --set properties.zoneRedundant=false
312
+
313
+
az appservice plan update -g <resource group name> -n <app service plan name> --set zoneRedundant=false sku.capacity=1
314
+
```
315
+
<!-- - **Disable zone redundancy.** To disable zone redundancy, you can set the App Service plan or App Service Environment `zoneRedundant` property to `false` or you can disable it in the Azure portal. -->
0 commit comments