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
@@ -35,7 +35,7 @@ Availability zone configuration for Azure Functions depends on your [Functions h
35
35
> [!IMPORTANT]
36
36
> Before configuring zone redundancy, review the requirements and details listed in [Reliability in Azure Functions - Resilience to availability zone failures](/azure/reliability/reliability-functions?pivots=premium#resilience-to-availability-zone-failures).
37
37
>
38
-
> You can only enable availability zones in the plan when you create your app. You can't convert an existing Premium plan to use availability zones.
38
+
> You can enable or disable availability zones on existing Elastic Premium plans using the Azure CLI. See [Enable zone redundancy on an existing plan](#enable-zone-redundancy-on-an-existing-plan) for important details about Elastic Premium-specific capacity behavior.
39
39
40
40
::: zone-end
41
41
@@ -253,7 +253,7 @@ You can use a [Bicep file](/azure/azure-resource-manager/bicep/quickstart-create
253
253
The only properties to be aware of while creating a zone-redundant hosting plan are the `zoneRedundant` property and the plan's instance count (`capacity`) fields. The `zoneRedundant` property must be set to `true` and the `capacity` property should be set based on the workload requirement, but not less than `3`. Choosing the right capacity varies based on several factors and high availability / fault tolerance strategies. A good rule of thumb is to specify sufficient instances for the application to ensure that losing one zone instance leaves sufficient capacity to handle expected load.
254
254
255
255
> [!IMPORTANT]
256
-
> Azure Functions apps hosted on an Elastic Premium, zone-redundant plan must have a minimum [always ready instance](/azure/azure-functions/functions-premium-plan#always-ready-instances) count of 3. This minimum ensures that a zone-redundant function app always has enough instances to satisfy at least one worker per zone.
256
+
> Azure Functions apps hosted on an Elastic Premium, zone-redundant plan must have a minimum [always ready instance](/azure/azure-functions/functions-premium-plan#always-ready-instances) count of 2. This minimum ensures that a zone-redundant function app always has enough instances to satisfy at least one worker per zone.
257
257
258
258
Following is a Bicep template snippet for a zone-redundant, Premium plan. It shows the `zoneRedundant` field and the `capacity` specification.
259
259
@@ -293,7 +293,7 @@ You can use an [ARM template](/azure/azure-resource-manager/templates/quickstart
293
293
The only properties to be aware of while creating a zone-redundant hosting plan are the `zoneRedundant` property and the plan's instance count (`capacity`) fields. The `zoneRedundant` property must be set to `true` and the `capacity` property should be set based on the workload requirement, but not less than `3`. Choosing the right capacity varies based on several factors and high availability / fault tolerance strategies. A good rule of thumb is to specify sufficient instances for the application to ensure that losing one zone instance leaves sufficient capacity to handle expected load.
294
294
295
295
> [!IMPORTANT]
296
-
> Azure Functions apps hosted on an Elastic Premium, zone-redundant plan must have a minimum [always ready instance](/azure/azure-functions/functions-premium-plan#always-ready-instances) count of 3. This minimum ensures that a zone-redundant function app always has enough instances to satisfy at least one worker per zone.
296
+
> Azure Functions apps hosted on an Elastic Premium, zone-redundant plan must have a minimum [always ready instance](/azure/azure-functions/functions-premium-plan#always-ready-instances) count of 2. This minimum ensures that a zone-redundant function app always has enough instances to satisfy at least one worker per zone.
297
297
298
298
Following is an ARM template snippet for a zone-redundant, Premium plan. It shows the `zoneRedundant` field and the `capacity` specification.
299
299
@@ -446,24 +446,207 @@ In this template, replace `<YOUR_PLAN_NAME>` and `<YOUR_REGION_NAME>` with the n
446
446
447
447
::: zone pivot="premium-plan"
448
448
449
-
You can't change the availability zone support of an existing Elastic Premium plan. Instead, you need to migrate to a new zone-redundant plan.
449
+
You can enable or disable zone redundancy on existing Elastic Premium plans using the Azure CLI. The `zoneRedundant` property is mutable for Elastic Premium plans, allowing you to toggle availability zone support without creating a new plan.
450
450
451
-
### Downtime
451
+
> [!IMPORTANT]
452
+
> Elastic Premium plans capacity behavior differs from Dedicated (App Service) plans. In Elastic Premium, the plan's instance count (`sku.capacity`) is **derived from the app level**, not set directly on the plan. Each function app in the plan has a `minimumElasticInstanceCount` property (always-ready instances), and the control plane automatically sets the plan's `sku.capacity` to the **highest `minimumElasticInstanceCount` across all apps** in the plan.
453
+
>
454
+
> When enabling zone redundancy, you must update **both** the plan-level `zoneRedundant` property to `true` and `sku.capacity` to `2`**and** the app-level `minimumElasticInstanceCount` to at least 2 on each function app that you want to be zone redundant. Setting in the plan update command alone does not enforce a minimum of 2 instances.
455
+
456
+
#### [Azure portal](#tab/azure-portal)
457
+
458
+
Portal support for toggling availability zone redundancy on existing Elastic Premium plans is not yet available. Use the Azure CLI tab for the current supported workflow.
459
+
460
+
#### [Azure CLI](#tab/azure-cli)
461
+
462
+
Follow these steps to enable zone redundancy on an existing Elastic Premium plan:
463
+
464
+
1. Enable zone redundancy on the plan:
465
+
466
+
```azurecli
467
+
az appservice plan update \
468
+
--resource-group <RESOURCE_GROUP> \
469
+
--name <PLAN_NAME> \
470
+
--set zoneRedundant=true sku.capacity=2
471
+
```
472
+
473
+
> [!NOTE]
474
+
> The `sku.capacity=2` parameter in this command sets the intended minimum, but it is not enforced until you complete step 2.
475
+
476
+
1. Update always-ready instances to at least 2 for each function app that needs to be zone zone redundant in the plan:
477
+
478
+
```azurecli
479
+
az functionapp update \
480
+
--resource-group <RESOURCE_GROUP> \
481
+
--name <APP_NAME> \
482
+
--set siteConfig.minimumElasticInstanceCount=2
483
+
```
484
+
485
+
The plan's actual `sku.capacity` will update to reflect the highest `minimumElasticInstanceCount` across all apps.
486
+
487
+
To disable zone redundancy on an existing plan:
488
+
489
+
```azurecli
490
+
az appservice plan update \
491
+
--resource-group <RESOURCE_GROUP> \
492
+
--name <PLAN_NAME> \
493
+
--set zoneRedundant=false
494
+
```
495
+
496
+
After disabling zone redundancy, you can optionally reduce `minimumElasticInstanceCount` back to 1 on your function apps if desired.
497
+
498
+
#### [Bicep template](#tab/bicep)
499
+
500
+
You can update an existing Elastic Premium plan to be zone-redundant using Bicep templates. The following example shows how to enable zone redundancy:
> Remember to update the `minimumElasticInstanceCount` property to at least 2 on all function apps in the plan to ensure zone redundancy requirements are met.
547
+
548
+
#### [ARM template](#tab/arm-template)
452
549
453
-
The downtime required for this migration depends on how you redirect traffic during the migration to your new availability zone-enabled function app:
550
+
You can update an existing Elastic Premium plan to be zone-redundant using ARM templates. The following example shows how to enable zone redundancy:
454
551
455
-
- Consider HTTP-based functions that use an [Application Gateway](/azure/app-service/networking/app-gateway-with-service-endpoints), [custom domain](/azure/app-service/app-service-web-tutorial-custom-domain), or [Azure Front Door](/azure/frontdoor/front-door-overview). In this case, downtime depends on how long it takes to update those respective services with the new app information.
456
-
- You might also be routing traffic to multiple apps at the same time using a service such as [Azure Traffic Manager](/azure/app-service/web-sites-traffic-manager). In this scenario, you can only fully switch to the new zone-redundant app after everything is deployed and tested fully.
457
-
- For message-based functions, you should [write defensive functions](/azure/azure-functions/performance-reliability#write-defensive-functions) to ensure messages aren't lost during the migration.
> Remember to update the `minimumElasticInstanceCount` property to at least 2 on all function apps in the plan to ensure zone redundancy requirements are met.
597
+
598
+
---
599
+
600
+
### Verify instance zone placement
601
+
602
+
After enabling zone redundancy, you can verify that your function app instances are distributed across availability zones.
603
+
604
+
#### [Azure portal](#tab/azure-portal)
605
+
606
+
1. In the Azure portal, search for and select your function app.
607
+
608
+
1. Under **Settings**, select **Instances**.
609
+
610
+
1. The **Instances** page shows each running instance and the availability zone it's placed in.
458
611
459
-
### Migration steps
612
+
#### [Azure CLI](#tab/azure-cli)
613
+
614
+
Use the following Azure CLI commands to verify zone distribution:
In this example, replace `<RESOURCE_GROUP>` and `<APP_NAME>` with the names of your resource group and function app, respectively.
460
630
461
-
To enable an existing Premium plan function app to use availability zones, redeploy your project files to a new function app hosted in a zone-redundant Premium plan. Follow these steps:
631
+
Example output:
462
632
463
-
1. If you're already hosted in a Premium plan in a supported region, you can reuse your existing resource group and skip to the next step. Otherwise, create a new resource group in a supported region. For a list of regions that support zone redundancy for Azure Functions Premium plans, see [Reliability in Azure Functions - Resilience to availability zone failures - Requirements](/azure/reliability/reliability-functions#requirements).
464
-
1. Create a zone-redundant Premium plan in a supported region.
465
-
1. Create a function app in the new Premium plan and deploy your project code to this new app using your desired [deployment method](functions-deployment-technologies.md).
466
-
1. After the new app is up and running successfully, you can optionally disable or delete the nonzonal app.
633
+
```output
634
+
MachineName PhysicalZone
635
+
-------------- --------------
636
+
pl1sdlwk0002Q7 westus3-az3
637
+
pl0sdlwk0002HP westus3-az1
638
+
```
639
+
640
+
In the output:
641
+
-`machineName` is the internal name of the worker instance
642
+
-`physicalZone` shows the actual availability zone the instance is placed in (format: `{region}-az{N}`)
643
+
- For a zone-redundant plan with 2+ instances, you should see instances distributed across different zones
644
+
645
+
### Troubleshooting
646
+
647
+
If zone redundancy is not working as expected after following these steps, review the [Common Issues and Solutions](https://techcommunity.microsoft.com/blog/appsonazureblog/deep-dive-on-availability-zones-in-azure-app-service/4433526) section in the deep dive blog post on Availability Zones in Azure App Service. While the blog post focuses on App Service plans, many troubleshooting steps apply to Elastic Premium plans as well.
0 commit comments