Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Zone redundancy enables your function apps to be resilient to problems in Azure availability zones, so your app remains available when a datacenter or zone has an outage. This article provides step-by-step guidance for configuring Azure Functions to be zone-redundant, depending on your hosting plan. For information about how availability zones work with Azure Functions, see Reliability in Azure Functions.
Availability zone configuration for Azure Functions depends on your Functions hosting plan:
| Hosting plan | Support level | Configuration section |
|---|---|---|
| Flex Consumption plan | GA | Select Flex Consumption at the top of this article. |
| Elastic Premium plan | GA | Select Premium at the top of this article. |
| Dedicated (App Service) plan | GA | See Configure availability zones for App Service. |
| Consumption plan | n/a | Not supported by the Consumption plan. |
Note
The content in this article isn't relevant to the currently selected hosting plan. To choose a different plan, use the selector at the top of this article. For a comparison of all hosting plans, see Azure Functions hosting options.
Zone redundancy isn't supported in the Consumption plan. Consider migrating to the Flex Consumption plan or Premium plan for availability zone support.
Note
The content in this article isn't relevant to the currently selected hosting plan. To choose a different plan, use the selector at the top of this article. For a comparison of all hosting plans, see Azure Functions hosting options.
For Dedicated (App Service) plan zone redundancy configuration, see Configure availability zones for App Service.
Note
The content in this article isn't relevant to the currently selected hosting plan. To choose a different plan, use the selector at the top of this article. For a comparison of all hosting plans, see Azure Functions hosting options.
When running functions on Azure Container Apps, availability zone redundancy is configured at the Container Apps environment level. See Reliability in Azure Container Apps.
Important
Before configuring zone redundancy, review the requirements and details listed in Reliability in Azure Functions - Resilience to availability zone failures.
Important
Before configuring zone redundancy, review the requirements and details listed in Reliability in Azure Functions - Resilience to availability zone failures.
You can enable or disable availability zones on existing Elastic Premium plans using the Azure CLI. For more information, including important details about Elastic Premium-specific capacity behaviors, see Enable zone redundancy on an existing plan.
View regions that support availability zones
You can deploy zone-redundant apps to a Flex Consumption plan only in specific regions. To see the current list of supported regions, use Azure CLI:
If you didn't already, install Azure CLI and sign in to Azure.
az loginUse the
az functionapp list-flexconsumption-locationscommand with the--zone-redundant=trueargument. This command returns a list of regions that currently support zone-redundant Flex Consumption plans:az functionapp list-flexconsumption-locations --zone-redundant=true --query "sort_by(@, &name)[].{Region:name}" -o table
Create a zone-redundant function app
Follow these steps to create a zone-redundant Flex Consumption plan when you create your app.
To create a function app in a zone-redundant plan, you must have an existing zone-redundant storage account. If you don't already have a zone-redundant storage account, create one before you proceed.
In the Azure portal, go to Create Function App. For more information about creating a function app in the portal, see Create a function app.
Select Flex Consumption and then select the Select button.
On the Create Function App (Flex Consumption) page, on the Basics tab, enter the settings for your function app. Pay special attention to the settings in the following table (also highlighted in the following screenshot), which have specific requirements for zone redundancy.
Setting Suggested value Notes for zone redundancy Region Your preferred supported region The region in which your Flex Consumption plan is created. 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. Zone redundancy Enabled This setting specifies whether your app is zone redundant. You can only select Enabledwhen you've chosen a region that supports zone redundancy.
On the Storage tab, select the zone-redundant storage account for your function app. Pay special attention to the setting in the following table, which has specific requirements for zone redundancy.
Setting Suggested value Notes for zone redundancy Storage account A zone-redundant storage account As described in the reliability guide for Azure Functions, use a zone-redundant storage account for your zone-redundant function app. For the rest of the function app creation process, create your function app as normal. There are no settings in the rest of the creation process that affect zone redundancy.
After you create and deploy the zone-redundant plan, the Flex Consumption function app hosted on your new plan is considered zone-redundant.
Follow these steps to create a zone-redundant Premium plan and app.
In the Azure portal, go to Create Function App. For more information about creating a function app in the portal, see Create a function app.
Select Functions Premium and then select Select.
On Create Function App (Functions Premium), on the Basics tab, enter the settings for your function app. Pay special attention to the settings in the following table (also highlighted in the following screenshot), which have specific requirements for zone redundancy.
Setting Suggested value Notes for zone redundancy Region Your preferred supported region The region in which you create your Elastic Premium plan. Pick a region that supports availability zones. 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. Pricing plan One of the Elastic Premium plans. For more information, see Available instance SKUs. This article describes how to create a zone redundant app in a Premium plan. Zone redundancy isn't currently available in Consumption plans. For information on zone redundancy on App Service plans, see Configure availability zones for App Service. Zone redundancy Enabled This setting specifies whether your app is zone redundant. You can't select Enabledunless you choose a region that supports zone redundancy, as described previously.
On the Storage tab, enter the settings for your function app storage account. Pay special attention to the setting in the following table, which has specific requirements for zone redundancy.
Setting Suggested value Notes for zone redundancy Storage account A zone-redundant storage account As described in the reliability guide for Azure Functions, use a zone-redundant storage account for your zone-redundant function app. For the rest of the function app creation process, create your function app as normal. There are no settings in the rest of the creation process that affect zone redundancy.
After you create and deploy the zone-redundant plan, any function app you host on your new plan is considered zone-redundant.
Enable zone redundancy on an existing plan
Changing the zone redundancy of your app requires a restart, which causes downtime in your app. Before updating your Flex Consumption plan to be zone-redundant, update the default host storage account to also be zone redundant.
Tip
If you use a separate storage account for the app's deployment container, update it to be zone redundant as well.
Use these steps to prepare your storage accounts for the change:
- Review Storage Considerations.
- Create or identify a zone-redundant storage account to be the default host storage account for the app.
- Update the storage-related application settings of the app, like
AzureWebJobsStorage, to reference the zone-redundant storage account. See Work with application settings. - Update the deployment storage account for the app, which can be the same or different as the storage account associated with the app. See Configure deployment settings.
After you update the storage accounts used by your app, update the Flex Consumption plan to be zone-redundant.
In the Azure portal, search for and select the function app to update.
Under Settings, select Scale and Concurrency.
On the Zone redundancy tab, check Add zone redundancy to enable the feature. If already checked, you can uncheck this box to disable the feature.
Select Save to commit your changes and restart the app.
Keep these important considerations in mind before you enable zone redundancy in your Premium plan hosted app:
The
zoneRedundantproperty of an Elastic Premium plan is mutable, so you can toggle availability zone support without creating a new plan.Unlike in a Dedicated (App Service) plan, an Elastic Premium capacity behavior (
sku.capacity) for each app is derived from app-level settings not just the plan setting.To enable zone redundancy, you must update settings at both the plan level and the app level:
Level Property Required value Notes Plan zoneRedundanttrueEnables availability zone distribution Plan sku.capacity2or higherSets the intended minimum instance count App (each) minimumElasticInstanceCount2or higherThe control plane sets plan sku.capacityto the highest value across all apps. Settingsku.capacityalone doesn't enforce a minimum, so you must also set this app-level property.You can't currently configure availability zone redundancy on existing Elastic Premium plans from the portal.
To enable availability zone redundancy in your Premium plan app:
Not currently supported, choose another tab.
Verify instance zone placement
After you enable zone redundancy, you can confirm that your function app instances are distributed across availability zones by using either the Azure portal or Azure CLI.
In the Azure portal, go to your function app. Under Settings, select Instances. The Instances page shows each running instance and the availability zone it's placed in.
Troubleshooting
If zone redundancy isn't working as expected after following these steps, check the following items:
Verify the region supports availability zones for your plan type. See Reliability in Azure Functions - Requirements.
Ensure your storage account uses a zone-redundant SKU (ZRS or GZRS).
Confirm that
minimumElasticInstanceCountis set to at least 2 on each app.For issues related to scale units and SKU requirements, review the Common Issues and Solutions section in the deep dive blog post on Availability Zones in Azure App Service.
Next steps
- Reliability in Azure Functions - Conceptual guidance on availability zone support and other reliability approaches and patterns.
- Automate resource deployment in Azure Functions - Learn more about Infrastructure as Code options.
- Azure Functions hosting plans - Compare different hosting options.
- Storage considerations for Azure Functions - Understand storage requirements for zone-redundant setups.