Skip to content

Commit 625f2c1

Browse files
authored
acrolinx
1 parent 7c7a171 commit 625f2c1

File tree

1 file changed

+151
-26
lines changed

1 file changed

+151
-26
lines changed

articles/reliability/reliability-app-service.md

Lines changed: 151 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ This article describes reliability support in [Azure App Service](../app-service
1717

1818
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)
1919

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.
2121

2222
## Production deployment recommendations
2323

@@ -57,20 +57,27 @@ Azure App Service can be configured as *zone redundant*, which means that your r
5757
Instance spreading with a zone-redundant deployment is determined using the following rules. These rules apply even as the app scales in and out:
5858

5959
- 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.
6161

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"::: -->
6368
6469
- The instances spread evenly if you specify a capacity larger than two, and the number of instances is divisible by two.
6570
- Any instance counts beyond 2*N are spread across the remaining one or two zones.
6671
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.
6773
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+
```
6977

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). -->
7179

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 -->
7481

7582
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).
7683

@@ -110,9 +117,15 @@ You must use the [Premium v2, Premium v3, or Isolated v2 plan types](/azure/app-
110117

111118
- 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.
112119

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.
114123

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. -->
116129
117130
- You must deploy a minimum of two instances in your plan.
118131
@@ -154,40 +167,152 @@ If you enable availability zones but specify a capacity less than two, the platf
154167
155168
::: zone pivot="premium"
156169
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.
171+
172+
```bicep
173+
resource appServicePlan 'Microsoft.Web/serverfarms@2022-03-01' = {
174+
name: appServicePlanName
175+
location: location
176+
sku: {
177+
name: sku
178+
capacity: 2
179+
}
180+
kind: 'linux'
181+
properties: {
182+
reserved: true
183+
zoneRedundant: true
184+
}
185+
}
186+
```
187+
188+
```azurecli
189+
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.
159201
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.
162203
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"::: -->
164205
165206
> [!NOTE]
166207
> Changing the zone redundancy status of an App Service plan is almost instaneous. You don't experience downtime or performance issues during the process.
167208
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. -->
169215
170216
::: zone-end
171217
172218
::: zone pivot="isolated"
173219
174220
- **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+
175222
To create a new zone-redundant App Service plan in an existing App Service Environment:
176223
177224
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.
226+
227+
```bicep
228+
resource appServicePlan 'Microsoft.Web/serverfarms@2022-03-01' = {
229+
name: appServicePlanName
230+
location: location
231+
hostingEnvironmentProfile: {
232+
id: '...'
233+
}
234+
sku: {
235+
name: sku
236+
capacity: 2
237+
}
238+
kind: 'linux'
239+
properties: {
240+
reserved: true
241+
zoneRedundant: true
242+
}
243+
}
244+
```
245+
246+
```azurecli
247+
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.
256+
257+
```bicep
258+
resource asev3 'Microsoft.Web/hostingEnvironments@2020-12-01' = {
259+
name: aseName
260+
location: location
261+
kind: 'ASEV3'
262+
dependsOn: [
263+
virtualnetwork
264+
]
265+
properties: {
266+
...
267+
zoneRedundant: true
268+
}
269+
}
270+
```
271+
272+
```azurecli
273+
az resource update --ids /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Web/hostingEnvironments/{aseName} --set properties.zoneRedundant=true
274+
```
186275
187276
> [!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.
284+
285+
```bicep
286+
resource appServicePlan 'Microsoft.Web/serverfarms@2022-03-01' = {
287+
name: appServicePlanName
288+
location: location
289+
hostingEnvironmentProfile: {
290+
id: '...'
291+
}
292+
sku: {
293+
name: sku
294+
capacity: 2
295+
}
296+
kind: 'linux'
297+
properties: {
298+
reserved: true
299+
zoneRedundant: true
300+
}
301+
}
302+
```
303+
304+
```azurecli
305+
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. -->
191316
192317
::: zone-end
193318

0 commit comments

Comments
 (0)