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. |
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 only enable availability zones in the plan when you create your app. You can't convert an existing Premium plan to use availability zones.
View regions that support availability zones
Zone-redundant Flex Consumption plans can be deployed into a specific set of regions. For the current list, use the Azure CLI:
If you haven't done so already, install and sign in to Azure using the Azure CLI:
az loginUse the
az functionapp list-flexconsumption-locationscommand with the--zone-redundant=trueargument, which 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 the Create Function App page. 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, we strongly recommend using 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 the zone-redundant plan is created and deployed, 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 the Create Function App page. For more information about creating a function app in the portal, see Create a function app.
Select Functions Premium and then select the Select button.
On the Create Function App (Functions Premium) 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 Elastic Premium plan is created. You must 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 won't be able to select Enabledunless you have chosen 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, we strongly recommend using 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 the zone-redundant plan is created and deployed, any function app hosted 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, you should update the default host storage account to also be zone redundant. If you use a separate storage account for the app's deployment container, you should 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 the storage accounts used by your app are updated, you can update the Flex Consumption plan to be zone-redundant using Bicep or ARM templates. The Azure portal currently doesn't support making zone redundancy updates to the plan.
Update zone redundancy settings
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.
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.
Downtime
The downtime required for this migration depends on how you redirect traffic during the migration to your new availability zone-enabled function app:
- Consider HTTP-based functions that use an Application Gateway, custom domain, or Azure Front Door. In this case, downtime depends on how long it takes to update those respective services with the new app information.
- You might also be routing traffic to multiple apps at the same time using a service such as Azure Traffic Manager. In this scenario, you can only fully switch to the new zone-redundant app after everything is deployed and tested fully.
- For message-based functions, you should write defensive functions to ensure messages aren't lost during the migration.
Migration steps
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:
- 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.
- Create a zone-redundant Premium plan in a supported region.
- Create a function app in the new Premium plan and deploy your project code to this new app using your desired deployment method.
- After the new app is up and running successfully, you can optionally disable or delete the nonzonal app.
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