为 Azure 逻辑应用中的集成帐户设置跨区域灾难恢复Set up cross-region disaster recovery for integration accounts in Azure Logic Apps

B2B 工作负荷涉及订单和发票等现金交易。B2B workloads involve money transactions like orders and invoices. 对于企业而言,在灾难事件中快速恢复以满足与合作伙伴达成一致意见的企业级 SLA,这非常重要。During a disaster event, it's critical for a business to quickly recover to meet the business-level SLAs agreed upon with their partners. 本文演示为 B2B 工作负荷生成业务连续性计划。This article demonstrates how to build a business continuity plan for B2B workloads.

  • 灾难恢复就绪性Disaster Recovery readiness
  • 在发生灾难事件时故障转移到次要区域Fail over to secondary region during a disaster event
  • 在发生灾难事件后,故障回复到主区域Fall back to primary region after a disaster event

灾难恢复就绪性Disaster Recovery readiness

  1. 确定次要区域并在其中创建集成帐户Identify a secondary region and create an integration account in the secondary region.

  2. 为所需的消息流添加合作伙伴、架构和协议,在该消息流中,运行状态需要复制到次要区域集成帐户。Add partners, schemas, and agreements for the required message flows where the run status needs to be replicated to secondary region integration account.

    提示

    确保集成帐户项目命名约定在各个区域中保持一致。Make sure there's consistency in the integration account artifact's naming convention across regions.

  3. 为了从主要区域提取运行状态,请在次要区域中创建逻辑应用。To pull the run status from the primary region, create a logic app in the secondary region.

    此逻辑应用应该具有一个触发器和一个操作 。This logic app should have a trigger and an action . 触发器应连接到主要区域集成帐户,操作应连接到次要区域集成帐户。The trigger should connect to primary region integration account, and the action should connect to secondary region integration account. 基于时间间隔,触发器将轮询主要区域的运行状态表并提取新记录(如果有)。Based on the time interval, the trigger polls the primary region run status table and pulls the new records, if any. 操作会将这些新记录更新到次要区域集成帐户。The action updates them to secondary region integration account. 这有助于将主要区域的增量运行时状态获取到次要区域。This helps to get incremental runtime status from primary region to secondary region.

  4. 根据 B2B 协议(X12、AS2 和 EDIFACT),逻辑应用集成帐户中的业务连续性旨在支持这种行为。Business continuity in Logic Apps integration account is designed to support based on B2B protocols - X12, AS2, and EDIFACT. 若要查找详细步骤,请选择各自的链接。To find detailed steps, select the respective links.

  5. 建议也在次要区域中部署所有主要区域资源。The recommendation is to deploy all primary region resources in a secondary region too.

    主要区域资源包括 Azure SQL 数据库或 Azure Cosmos DB、用于消息传送的 Azure 服务总线和 Azure 事件中心、Azure API 管理,以及 Azure 应用服务中的 Azure 逻辑应用功能。Primary region resources include Azure SQL Database or Azure Cosmos DB, Azure Service Bus and Azure Event Hubs used for messaging, Azure API Management, and the Azure Logic Apps feature in Azure App Service.

  6. 在主要区域和次要区域之间建立连接。Establish a connection from a primary region to a secondary region. 为了从主要区域提取运行状态,请在次要区域中创建逻辑应用。To pull the run status from a primary region, create a logic app in a secondary region.

    逻辑应用应该具有一个触发器和一个操作。The logic app should have a trigger and an action. 触发器应连接到主要区域集成帐户。The trigger should connect to a primary region integration account. 操作应连接到次要区域集成帐户。The action should connect to a secondary region integration account. 基于时间间隔,触发器将轮询主要区域的运行状态表并提取新记录(如果有)。Based on the time interval, the trigger polls the primary region run status table and pulls the new records, if any. 操作会将这些新记录更新到次要区域集成帐户。The action updates them to a secondary region integration account. 此过程有助于将主要区域的增量运行时状态获取到次要区域。This process helps to get incremental runtime status from the primary region to the secondary region.

根据 B2B 协议(X12、AS2 和 EDIFACT),逻辑应用集成帐户中的业务连续性旨在提供这种行为。Business continuity in a Logic Apps integration account provides support based on the B2B protocols X12, AS2, and EDIFACT. 有关使用 X12 和 AS2 的详细步骤,请参阅本文中的 X12AS2For detailed steps on using X12 and AS2, see X12 and AS2 in this article.

在发生灾难事件时故障转移到次要区域Fail over to a secondary region during a disaster event

在发生灾难事件时,如果主要区域不可用于业务连续性,则将流量定向到次要区域。During a disaster event, when the primary region is not available for business continuity, direct traffic to the secondary region. 次要区域可帮助企业根据与其合作伙伴达成的的 RPO/RTO 快速恢复功能。A secondary region helps a business to recover functions quickly to meet the RPO/RTO agreed upon by their partners. 另外,也可以最大限度地减少将故障从一个区域转移到另一个区域的工作。It also minimizes efforts to fail over from one region to another region.

将控制编号从主要区域复制到次要区域时,可能会像预期的那样出现延迟。There is an expected latency while copying control numbers from a primary region to a secondary region. 要避免在发生灾难事件时会将生成的重复控制编号发送给合作伙伴,建议使用 PowerShell cmdlet 在次要区域协议中增加控制编号。To avoid sending duplicate generated control numbers to partners during a disaster event, the recommendation is to increment the control numbers in the secondary region agreements by using PowerShell cmdlets.

在发生灾难事件后,故障回复到主要区域Fall back to a primary region post-disaster event

可以故障回复到主要区域时,请执行以下步骤:To fall back to a primary region when it is available, follow these steps:

  1. 停止接收在次要区域中来自合作伙伴的消息。Stop accepting messages from partners in the secondary region.

  2. 使用 PowerShell cmdlet 为所有的主要区域协议增加生成的控制编号。Increment the generated control numbers for all the primary region agreements by using PowerShell cmdlets.

  3. 将流量从次要区域定向到主要区域。Direct traffic from the secondary region to the primary region.

  4. 检查是否已启用逻辑应用,该应用在次要区域中创建,用于提取主要区域的运行状态。Check that the logic app created in the secondary region for pulling run status from the primary region is enabled.

X12X12

根据控制编号,设计 EDI X12 文档的业务连续性:Business continuity for EDI X12 documents is based on control numbers:

提示

还可使用 X12 快速入门模板创建逻辑应用。You can also use the X12 quick start template to create logic apps. 使用该模板的先决条件是创建主要和次要的集成帐户。Creating primary and secondary integration accounts are prerequisites to use the template. 该模板有助于创建两个逻辑应用,一个用于接收的控制编号,另一个用于生成的控制编号。The template helps to create two logic apps, one for received control numbers and another for generated control numbers. 各自的触发器和操作会在逻辑应用中创建,然后将触发器连接到主要集成帐户,将操作连接到次要集成帐户。Respective triggers and actions are created in the logic apps, connecting the trigger to the primary integration account and the action to the secondary integration account.

先决条件Prerequisites

若要启用入站消息的灾难恢复,请选择 X12 协议“接收设置”中的重复检查设置。To enable disaster recovery for inbound messages, select the duplicate check settings in the X12 agreement's Receive Settings.

选择重复检查设置

  1. 在次要区域中创建逻辑应用Create a logic app in a secondary region.

  2. 搜索“X12” ,然后选择“X12 - 当修改控制编号时” 。Search on X12 , and select X12 - When a control number is modified .

    搜索 X12

    触发器提示与集成帐户建立连接。The trigger prompts you to establish a connection to an integration account. 触发器应已连接到主要区域集成帐户。The trigger should be connected to a primary region integration account.

  3. 输入连接名称,从列表中选择“主要区域集成帐户”,并选择“创建” 。Enter a connection name, select your primary region integration account from the list, and choose Create .

    主要区域集成帐户名称

  4. “开始同步控制编号的 DateTime”设置是可选的。 The DateTime to start control number sync setting is optional. “频率”可以设置为“天” 、“小时” 、“分钟” 或“秒” ,中间要有间隔。 The Frequency can be set to Day , Hour , Minute , or Second with an interval.

    DateTime 和频率

  5. 选择“新建步骤” > “添加操作” 。Select New step > Add an action .

    “新建步骤”、“添加操作”

  6. 搜索“X12” ,然后选择“X12 - 添加或更新控制编号” 。Search on X12 , and select X12 - Add or update control numbers .

    添加或更新控制编号

  7. 要将操作连接到次要区域集成帐户,请选择“更改连接” > “添加新连接” ,显示可用集成帐户的列表。To connect an action to a secondary region integration account, select Change connection > Add new connection for a list of the available integration accounts. 输入连接名称,从列表中选择“次要区域集成帐户”,并选择“创建” 。Enter a connection name, select your secondary region integration account from the list, and choose Create .

    次要区域集成帐户名称

  8. 通过单击右上角的图标,切换到原始输入。Switch to raw inputs by clicking on the icon in upper right corner.

    切换到原始输入

  9. 从动态内容选取器选择正文,并保存逻辑应用。Select Body from the dynamic content picker, and save the logic app.

    “动态内容”字段

    基于时间间隔,触发器将轮询主要区域收到的控制编号表并提取新记录。Based on the time interval, the trigger polls the primary region received control number table and pulls the new records. 该操作会更新次要区域集成帐户中的记录。The action updates the records in the secondary region integration account. 如果没有更新,触发器状态显示为“已跳过”。 If there are no updates, the trigger status appears as Skipped .

    控制编号表

基于时间间隔,增量的运行时状态将从主要区域复制到次要区域。Based on the time interval, the incremental runtime status replicates from a primary region to a secondary region. 在发生灾难事件时,如果主要区域不可用,则针对业务连续性将流量定向到次要区域。During a disaster event, when the primary region is not available, direct traffic to the secondary region for business continuity.

EDIFACTEDIFACT

EDI EDIFACT 文档的业务连续性基于控制编号。Business continuity for EDI EDIFACT documents is based on control numbers.

先决条件Prerequisites

若要启用入站消息的灾难恢复,请选择 EDIFACT 协议接受设置中的重复检查设置。To enable disaster recovery for inbound messages, select the duplicate check settings in your EDIFACT agreement's Receive Settings.

选择重复检查设置

  1. 在次要区域中创建逻辑应用Create a logic app in a secondary region.

  2. 搜索“EDIFACT” ,然后选择“EDIFACT - 当修改控制编号时” 。Search on EDIFACT , and select EDIFACT - When a control number is modified .

    搜索 EDIFACT

    触发器提示与集成帐户建立连接。The trigger prompts you to establish a connection to an integration account. 触发器应已连接到主要区域集成帐户。The trigger should be connected to a primary region integration account.

  3. 输入连接名称,从列表中选择“主要区域集成帐户”,并选择“创建” 。Enter a connection name, select your primary region integration account from the list, and choose Create .

    主要区域集成帐户名称

  4. “开始同步控制编号的 DateTime”设置是可选的。 The DateTime to start control number sync setting is optional. “频率”可以设置为“天” 、“小时” 、“分钟” 或“秒” ,中间要有间隔。 The Frequency can be set to Day , Hour , Minute , or Second with an interval.

    DateTime 和频率

  5. 选择“新建步骤” > “添加操作” 。Select New step > Add an action .

    “新建步骤”、“添加操作”

  6. 搜索“EDIFACT” ,然后选择“EDIFACT - 添加或更新控制编号” 。Search on EDIFACT , and select EDIFACT - Add or update control numbers .

    添加或更新控制编号

  7. 要将操作连接到次要区域集成帐户,请选择“更改连接” > “添加新连接” ,显示可用集成帐户的列表。To connect an action to a secondary region integration account, select Change connection > Add new connection for a list of the available integration accounts. 输入连接名称,从列表中选择“次要区域集成帐户”,并选择“创建” 。Enter a connection name, select your secondary region integration account from the list, and choose Create .

    次要区域集成帐户名称

  8. 通过单击右上角的图标,切换到原始输入。Switch to raw inputs by clicking on the icon in upper right corner.

    切换到原始输入

  9. 从动态内容选取器选择正文,并保存逻辑应用。Select Body from the dynamic content picker, and save the logic app.

    “动态内容”字段

    基于时间间隔,触发器将轮询主要区域收到的控制编号表并提取新记录。Based on the time interval, the trigger polls the primary region received control number table and pulls the new records. 操作会将这些记录更新到次要区域集成帐户中。The action updates the records to the secondary region integration account. 如果没有更新,触发器状态显示为“已跳过”。 If there are no updates, the trigger status appears as Skipped .

    控制编号表

基于时间间隔,增量的运行时状态将从主要区域复制到次要区域。Based on the time interval, the incremental runtime status replicates from a primary region to a secondary region. 在发生灾难事件时,如果主要区域不可用,则针对业务连续性将流量定向到次要区域。During a disaster event, when the primary region is not available, direct traffic to the secondary region for business continuity.

AS2AS2

根据消息 ID 和 MIC 值,设计针对使用 AS2 协议的文档的业务连续性。Business continuity for documents that use the AS2 protocol is based on the message ID and the MIC value.

提示

还可使用 AS2 快速入门模板创建逻辑应用。You can also use the AS2 quick start template to create logic apps. 使用该模板的先决条件是创建主要和次要的集成帐户。Creating primary and secondary integration accounts are prerequisites to use the template. 该模板有助于创建具有一个触发器和一个操作的逻辑应用。The template helps create a logic app that has a trigger and an action. 逻辑应用在主要集成帐户的触发器和次要集成帐户的操作之间建立连接。The logic app creates a connection from a trigger to a primary integration account and an action to a secondary integration account.

  1. 在次要区域中创建逻辑应用Create a logic app in the secondary region.

  2. 搜索“AS2” ,并选择“AS2 - 当创建 MIC 值时”。 Search on AS2 , and select AS2 - When a MIC value is created .

    搜索 AS2

    触发器提示与集成帐户建立连接。A trigger prompts you to establish a connection to an integration account. 触发器应已连接到主要区域集成帐户。The trigger should be connected to a primary region integration account.

  3. 输入连接名称,从列表中选择“主要区域集成帐户”,并选择“创建” 。Enter a connection name, select your primary region integration account from the list, and choose Create .

    主要区域集成帐户名称

  4. “开始同步 MIC 值的 DateTime”设置是可选的。 The DateTime to start MIC value sync setting is optional. “频率”可以设置为“天” 、“小时” 、“分钟” 或“秒” ,中间要有间隔。 The Frequency can be set to Day , Hour , Minute , or Second with an interval.

    DateTime 和频率

  5. 选择“新建步骤” > “添加操作” 。Select New step > Add an action .

    “新建步骤”、“添加操作”

  6. 搜索“AS2”,并选择“AS2 - 添加或更新 MIC 内容” 。Search on AS2 , and select AS2 - Add or update MIC contents .

    MIC 添加或更新

  7. 要将操作连接到次要区域集成帐户,请选择“更改连接” > “添加新连接”,显示可用集成帐户的列表。To connect an action to a secondary integration account, select Change connection > Add new connection for a list of the available integration accounts. 输入连接名称,从列表中选择“次要区域集成帐户”,并选择“创建” 。Enter a connection name, select your secondary region integration account from the list, and choose Create .

    次要区域集成帐户名称

  8. 通过单击右上角的图标,切换到原始输入。Switch to raw inputs by clicking on the icon in upper right corner.

    切换到原始输入

  9. 从动态内容选取器选择正文,并保存逻辑应用。Select Body from the dynamic content picker, and save the logic app.

    动态内容

    基于时间间隔,触发器将轮询主要区域表并提取新记录。Based on the time interval, the trigger polls the primary region table and pulls the new records. 操作会将这些新记录更新到次要区域集成帐户。The action updates them to the secondary region integration account. 如果没有更新,触发器状态显示为“已跳过”。 If there are no updates, the trigger status appears as Skipped .

    主要区域表

基于时间间隔,增量的运行时状态将从主要区域复制到次要区域。Based on the time interval, the incremental runtime status replicates from the primary region to the secondary region. 在发生灾难事件时,如果主要区域不可用,则针对业务连续性将流量定向到次要区域。During a disaster event, when the primary region is not available, direct traffic to the secondary region for business continuity.