Move your function app between regions in Azure Functions

This article describes how to move Azure Functions resources to a different Azure region. You might move your resources to another region for one of the following reasons:

  • Take advantage of a new Azure region
  • Deploy features or services that are available only in specific regions
  • Meet internal policy and governance requirements
  • Respond to capacity planning requirements

Azure Functions resources are region-specific and can't be moved across regions. You must create a copy of your existing function app resources in the target region, then redeploy your functions code over to the new app.

If minimal downtime is a requirement, consider running your function app in both regions to implement a disaster recovery architecture:

Prerequisites

  • Make sure that the target region supports Azure Functions and any related service whose resources you want to move
  • Have access to the original source code for the functions you're migrating

Prepare

Identify all the function app resources used on the source region, which may include the following:

Your functions may connect to other resources by using triggers or bindings. For information on how to move those resources across regions, see the documentation for the respective services.

You should be able to also export a template from existing resources.

Move

Deploy the function app to the target region and review the configured resources.

Redeploy function app

If you have access to the deployment and automation resources that created the function app in the source region, re-run the same deployment steps in the target region to create and redeploy your app.

If you only have access to the source code but not the deployment and automation resources you can deploy and configure the function app on the target region using any of the available deployment technologies or using one of the continuous deployment methods.

Review configured resources

Review and configure the resources identified in the Prepare step above in the target region if they weren't configured during the deploy.

Move considerations

  • If your deployment resources and automation doesn't create a function app, create an app of the same type in a new hosting plan in the target region
  • Function app names are globally unique in Azure, so the app in the target region can't have the same name as the one in the source region
  • References and application settings that connect your function app to dependencies need to be reviewed and, when needed, updated. For example, when you move a database that your functions call, you must also update the application settings or configuration to connect to the database in the target region. Some application settings such as the Application Insights instrumentation key or the Azure storage account used by the function app can be already be configured on the target region and do not need to be updated
  • Remember to verify your configuration and test your functions in the target region
  • If you had custom domain configured, remap the domain name
  • For Functions running on Dedicated plans also review the App Service Migration Plan in case the plan is shared with web apps

Clean up source resources

After the move is complete, delete the function app and hosting plan from the source region. You pay for function apps in Premium or Dedicated plans, even when the app itself isn't running.

Next steps

  • Review the Azure Architecture Center for examples of Azure Functions running in multiple regions as part of more advanced solution architectures