|
| 1 | +--- |
| 2 | +title: Relocate Azure App Services to another region |
| 3 | +description: Learn how to relocate Azure App Services to a another region |
| 4 | +author: anaharris-ms |
| 5 | +ms.author: anaharris |
| 6 | +ms.reviewer: anaharris |
| 7 | +ms.date: 07/09/2024 |
| 8 | +ms.service: app-service |
| 9 | +ms.topic: concept-article |
| 10 | +ms.custom: |
| 11 | + - subject-relocation |
| 12 | +--- |
| 13 | + |
| 14 | +# Relocate Azure App Services to another region |
| 15 | + |
| 16 | +#Customer intent: As an Azure service administrator, I want to move my App Service resources to another Azure region. |
| 17 | +--- |
| 18 | + |
| 19 | +# Move an App Service resource to another region |
| 20 | + |
| 21 | +This article describes how to move App Service resources to a different Azure region. You might move your resources to another region for a number of reasons. For example, to take advantage of a new Azure region, to deploy features or services available in specific regions only, to meet internal policy and governance requirements, or in response to capacity planning requirements. |
| 22 | + |
| 23 | +App Service resources are region-specific and can't be moved across regions. You must create a copy of your existing App Service resources in the target region, then move your content over to the new app. If your source app uses a custom domain, you can [migrate it to the new app in the target region](manage-custom-dns-migrate-domain.md) when you're finished. |
| 24 | + |
| 25 | +To make copying your app easier, you can [clone an individual App Service app](app-service-web-app-cloning.md) into an App Service plan in another region, but it does have [limitations](app-service-web-app-cloning.md#current-restrictions), especially that it doesn't support Linux apps. |
| 26 | + |
| 27 | +## Prerequisites |
| 28 | + |
| 29 | +- Make sure that the App Service app is in the Azure region from which you want to move. |
| 30 | +- Make sure that the target region supports App Service and any related service, whose resources you want to move. |
| 31 | +<!-- - Domain bindings, certificates, and managed identities can't replicated using the **Export template** method. You must create them manually. --> |
| 32 | + |
| 33 | +## Prepare |
| 34 | + |
| 35 | +Identify all the App Service resources that you're currently using. For example: |
| 36 | + |
| 37 | +- App Service apps |
| 38 | +- [App Service plans](overview-hosting-plans.md) |
| 39 | +- [Deployment slots](deploy-staging-slots.md) |
| 40 | +- [Custom domains purchased in Azure](manage-custom-dns-buy-domain.md) |
| 41 | +- [TLS/SSL certificates](configure-ssl-certificate.md) |
| 42 | +- [Azure Virtual Network integration](./overview-vnet-integration.md) |
| 43 | +- [Hybrid connections](app-service-hybrid-connections.md). |
| 44 | +- [Managed identities](overview-managed-identity.md) |
| 45 | +- [Backup settings](manage-backup.md) |
| 46 | + |
| 47 | +Certain resources, such as imported certificates or hybrid connections, contain integration with other Azure services. For information on how to move those resources across regions, see the documentation for the respective services. |
| 48 | + |
| 49 | +## Move |
| 50 | + |
| 51 | +1. [Create a back up of the source app](manage-backup.md). |
| 52 | +1. [Create an app in a new App Service plan, in the target region](app-service-plan-manage.md#create-an-app-service-plan). |
| 53 | +2. [Restore the back up in the target app](manage-backup.md) |
| 54 | +2. If you use a custom domain, [bind it preemptively to the target app](manage-custom-dns-migrate-domain.md#2-create-the-dns-records) with `asuid.` and [enable the domain in the target app](manage-custom-dns-migrate-domain.md#3-enable-the-domain-for-your-app). |
| 55 | +3. Configure everything else in your target app to be the same as the source app and verify your configuration. |
| 56 | +4. When you're ready for the custom domain to point to the target app, [remap the domain name](manage-custom-dns-migrate-domain.md#4-remap-the-active-dns-name). |
| 57 | + |
| 58 | +<!-- 1. Login to the [Azure portal](https://portal.azure.com) > **Resource Groups**. |
| 59 | +2. Locate the Resource Group that contains the source App Service resources and click on it. |
| 60 | +3. Select > **Settings** > **Export template**. |
| 61 | +4. Choose **Deploy** in the **Export template** blade. |
| 62 | +5. Click **TEMPLATE** > **Edit template** to open the template in the online editor. |
| 63 | +6. Click inside the online editor and type Ctrl+F (or ⌘+F on a Mac) and type `"identity": {` to find any managed identity definition. The following is an example if you have a user-assigned managed identity. |
| 64 | + ```json |
| 65 | + "identity": { |
| 66 | + "type": "UserAssigned", |
| 67 | + "userAssignedIdentities": { |
| 68 | + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/<group-name>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/<identity-name>": { |
| 69 | + "principalId": "00000000-0000-0000-0000-000000000000", |
| 70 | + "clientId": "00000000-0000-0000-0000-000000000000" |
| 71 | + } |
| 72 | + } |
| 73 | + }, |
| 74 | + ``` |
| 75 | +6. Click inside the online editor and type Ctrl+F (or ⌘+F on a Mac) and type `"Microsoft.Web/sites/hostNameBindings` to find all hostname bindings. The following is an example if you have a user-assigned managed identity. |
| 76 | + ```json |
| 77 | + { |
| 78 | + "type": "Microsoft.Web/sites/hostNameBindings", |
| 79 | + "apiVersion": "2018-11-01", |
| 80 | + "name": "[concat(parameters('sites_webapp_name'), '/', parameters('sites_webapp_name'), '.azurewebsites.net')]", |
| 81 | + "location": "West Europe", |
| 82 | + "dependsOn": [ |
| 83 | + "[resourceId('Microsoft.Web/sites', parameters('sites_webapp_name'))]" |
| 84 | + ], |
| 85 | + "properties": { |
| 86 | + "siteName": "<app-name>", |
| 87 | + "hostNameType": "Verified" |
| 88 | + } |
| 89 | + }, |
| 90 | + ``` |
| 91 | +6. Click inside the online editor and type Ctrl+F (or ⌘+F on a Mac) and type `"Microsoft.Web/certificates` to find all hostname bindings. The following is an example if you have a user-assigned managed identity. |
| 92 | + ```json |
| 93 | + { |
| 94 | + "type": "Microsoft.Web/certificates", |
| 95 | + "apiVersion": "2018-11-01", |
| 96 | + "name": "[parameters('certificates_test2_cephaslin_com_name')]", |
| 97 | + "location": "West Europe", |
| 98 | + "properties": { |
| 99 | + "hostNames": [ |
| 100 | + "[parameters('certificates_test2_cephaslin_com_name')]" |
| 101 | + ], |
| 102 | + "password": "[parameters('certificates_test2_cephaslin_com_password')]" |
| 103 | + } |
| 104 | + }, |
| 105 | + ``` |
| 106 | +7. Delete the entire JSON block. Click **Save** in the online editor. |
| 107 | +8. Click **BASICS** > **Create new** to create a new resource group. Type the group name and click **OK**. |
| 108 | +9. In **BASICS** > **Location**, select the region you want. --> |
| 109 | + |
| 110 | +## Clean up source resources |
| 111 | + |
| 112 | +Delete the source app and App Service plan. [An App Service plan in the non-free tier carries a charge, even if no app is running in it.](app-service-plan-manage.md#delete-an-app-service-plan) |
| 113 | + |
| 114 | +## Next steps |
| 115 | + |
| 116 | +[Azure App Service App Cloning Using PowerShell](app-service-web-app-cloning.md) |
0 commit comments