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

本文介绍了当发生影响整个 Azure 区域的灾难时,如何使应用服务资源在另一个 Azure 区域中恢复联机。This article describes how to bring App Service resources back online in a different Azure region during a disaster that impacts an entire Azure region. 当灾难导致整个 Azure 区域都处于脱机状态时,该区域中承载的所有应用服务应用都将被置于灾难恢复模式。When a disaster brings an entire Azure region offline, all App Service apps hosted in that region are placed in disaster recovery mode. 提供的功能可帮助你将应用还原到其他区域或从受影响的应用中恢复文件。Features are available to help you restore the app to a different region or recover files from the impacted app.

应用服务资源是特定于区域的,不能跨区域移动。App Service resources are region-specific and can't be moved across regions. 你必须将应用还原为其他区域中的新应用,然后为新应用创建镜像配置或资源。You must restore the app to a new app in a different region, and then create mirroring configurations or resources for the new app.

先决条件Prerequisites

  • 无。None. 从快照进行还原通常需要“高级”层,但在灾难恢复模式下,系统会自动为受影响的应用启用此功能,不管受影响的应用在哪个层中。Restoring from snapshot usually requires Premium tier, but in disaster recovery mode, it's automatically enabled for your impacted app, regardless which tier the impacted app is in.

准备Prepare

查明受影响的应用当前使用的所有应用服务资源。Identify all the App Service resources that the impacted app currently uses. 例如: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.

将应用还原到其他区域Restore app to a different region

  1. 在与受影响的应用不同的 Azure 区域中创建一个新的应用服务应用。Create a new App Service app in a different Azure region than the impacted app. 这是灾难恢复方案中的目标应用。This is the target app in the disaster recovery scenario.

  2. Azure 门户中,导航到受影响应用的管理页面。In the Azure portal, navigate to the impacted app's management page. 在发生故障的 Azure 区域中,受影响的应用会显示警告文本。In a failed Azure region, the impacted app shows a warning text. 单击该警告文本。Click the warning text.

    受影响应用的页面的屏幕截图。

  3. 在“还原备份”页面中,根据下表配置还原操作。In the Restore Backup page, configure the restore operation according to the following table. 完成后,单击 “确定”When finished, click OK.

    设置Setting Value 描述Description
    快照(预览版)Snapshot (Preview) 选择一个快照。Select a snapshot. 有两个最新的快照可用。The two most recent snapshots are available.
    还原目标Restore destination 现有应用Existing app 单击下方的“单击此处更改还原目标应用”说明,并选择目标应用。Click the note below that says Click here to change the restore destination app and select the target app. 在灾难场景中,只能将快照还原到其他 Azure 区域中的应用。In a disaster scenario, you can only restore the snapshot to an app in a different Azure region.
    还原站点配置Restore site configuration Yes

    “还原备份”页面的屏幕截图。

  4. 在目标应用中配置其他所有事项,以镜像受影响的应用并验证你的配置。Configure everything else in the target app to mirror the impacted app and verify your configuration.

  5. 当你已准备好将自定义域指向目标应用时,重新映射域名When you're ready for the custom domain to point to the target app, remap the domain name.

仅恢复应用内容Recover app content only

如果只想从受影响的应用恢复文件而不还原它,请使用以下步骤:If you only want to recover the files from the impacted app without restoring it, use the following steps:

  1. Azure 门户中,导航到受影响应用的管理页面,然后单击“获取发布配置文件”。In the Azure portal, navigate to the impacted app's management page and click Get publish profile.

    受影响应用的页面的屏幕截图。

  2. 打开下载的文件,查找名称中包含 ReadOnly - FTP 的发布配置文件。Open the downloaded file and find the publishing profile that contains ReadOnly - FTP in its name. 这是灾难恢复配置文件。This is the disaster recovery profile. 例如:For example:

    <publishProfile profileName="%app-name% - ReadOnly - FTP" publishMethod="FTP" publishUrl="ftp://%ftp-site%/site/wwwroot" ftpPassiveMode="True" userName="%app-name%\$%app-name%" userPWD="" destinationAppUrl="http://%app-name%.chinacloudsites.cn" SQLServerDBConnectionString="" mySQLDBConnectionString="" hostingProviderForumLink="" controlPanelLink="http://windows.azure.com" webSystem="WebSites">
        <databases />
    </publishProfile>
    

    复制三个属性值:Copy three attribute values:

    • publishUrl:FTP 主机名publishUrl: the FTP hostname
    • userNameuserPWD:FTP 凭据userName and userPWD: the FTP credentials
  3. 使用你选择的 FTP 客户端,使用主机名和凭据连接到受影响应用的 FTP 主机。Use the FTP client of your choice, connect to the impacted app's FTP host using the hostname and credentials.

  4. 连接后,下载整个 /site/wwwroot 文件夹。Once connected, download the entire /site/wwwroot folder. 以下屏幕截图显示了如何在 FileZilla 中下载。The following screenshot shows how you download in FileZilla.

    FileZilla 文件层次结构的屏幕截图。

后续步骤Next steps

在 Azure 中从快照还原应用Restore an app in Azure from a snapshot