将应用服务资源移动到其他区域Move an App Service resource to another region

本文介绍了如何将应用服务资源移动到其他 Azure 区域。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. 例如,利用新的 Azure 区域,部署仅在特定区域中可用的功能或服务,满足内部策略和监管要求,或者满足容量规划要求。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.

应用服务资源是特定于区域的,不能跨区域移动。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 when you're finished.

为了更轻松地复制应用,可以将个体应用服务应用克隆到另一个区域中的应用服务计划,但它具有限制,特别是它不支持 Linux 应用。To make copying your app easier, you can clone an individual App Service app into an App Service plan in another region, but it does have limitations, especially that it doesn't support Linux apps.

先决条件Prerequisites

  • 确保应用服务应用位于要从中进行移动的 Azure 区域中。Make sure that the App Service app is in the Azure region from which you want to move.
  • 确保目标区域支持你要移动其资源的应用服务和任何相关服务。Make sure that the target region supports App Service and any related service, whose resources you want to move.

准备Prepare

查明你当前正在使用的所有应用服务资源。Identify all the App Service resources that you're currently using. 例如:For example:

某些资源(例如导入的证书或混合连接)包含与其他 Azure 服务的集成。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.

移动Move

  1. 创建源应用的备份Create a back up of the source app.
  2. 在目标区域中的新应用服务计划中创建一个应用Create an app in a new App Service plan, in the target region.
  3. 在目标应用中还原备份Restore the back up in the target app
  4. 如果你使用自定义域,请使用 awverify.提前将其绑定到目标应用,并在目标应用中启用该域If you use a custom domain, bind it preemptively to the target app with awverify. and enable the domain in the target app.
  5. 将目标应用中的其他所有内容配置为与源应用相同,并验证你的配置。Configure everything else in your target app to be the same as the source app and verify your configuration.
  6. 当你已准备好将自定义域指向目标应用时,重新映射域名When you're ready for the custom domain to point to the target app, remap the domain name.

清理源资源Clean up source resources

删除源应用和应用服务计划。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.

后续步骤Next steps

使用 PowerShell 克隆 Azure 应用服务应用Azure App Service App Cloning Using PowerShell