将应用和解决方案从 BizTalk 服务迁移到 Azure 逻辑应用Migrate your apps and solutions from BizTalk Services to Azure Logic Apps

Microsoft Azure BizTalk 服务 (MABS) 即将停用。Microsoft Azure BizTalk Services (MABS) is retiring. 若要将 MABS 集成解决方案移动到 Azure 逻辑应用,请使用本文中的指南。To move your MABS integration solutions to Azure Logic Apps, follow the guidance in this article.

介绍Introduction

BizTalk 服务由两个子服务组成:BizTalk Services consists of two subservices:

  • Microsoft BizTalk 服务混合连接Microsoft BizTalk Services Hybrid Connections
  • 基于 EAI 和 EDI 网桥的集成EAI and EDI bridge-based integration

Azure 应用服务混合连接替代了 BizTalk 服务混合连接。Azure App Service Hybrid Connections replaces BizTalk Services Hybrid Connections. Azure 混合连接可以通过 Azure 门户利用 Azure 应用服务获得。Azure Hybrid Connections is available with Azure App Service through the Azure portal. 此服务提供了一个混合连接管理器,以用于管理现有 BizTalk 服务混合连接,以及你在门户中创建的新混合连接。This service provides a Hybrid Connection Manager so that you can manage existing BizTalk Services hybrid connections and also new hybrid connections that you create in the portal.

逻辑应用替代了 EAI 和 EDI 基于桥的集成,提供与 BizTalk 服务相同的所有功能以及其他功能。Logic Apps replaces EAI and EDI bridge-based integration with all the same capabilities in BizTalk Services and more. 此服务提供基于云规模消耗的工作流和业务流程功能,使得你可以使用浏览器或 Visual Studio 快速轻松地生成复杂的集成解决方案。This service provides cloud-scale consumption-based workflow and orchestration features for you to quickly and easily build complex integration solutions through a browser or with Visual Studio.

此表将 BizTalk 服务功能映射到逻辑应用。This table maps BizTalk Services capabilities to Logic Apps.

BizTalk 服务BizTalk Services 逻辑应用Logic Apps 目的Purpose
连接器Connector 连接器Connector 发送和接收数据Send and receive data
网桥Bridge 逻辑应用Logic App 管道处理器Pipeline processor
验证阶段Validate stage XML 验证操作XML Validation action 针对架构验证 XML 文档Validate an XML document against a schema
扩充阶段Enrich stage 数据令牌Data Tokens 将属性升级为消息或升级属性供路由决策Promote properties into messages or for routing decisions
转换阶段Transform stage 转换操作Transform action 将 XML 消息从一种格式转换为另一种格式Convert XML messages from one format to another
解码阶段Decode stage 平面文件解码操作Flat File Decode action 将平面文件转换为 XMLConvert from flat file to XML
编码阶段Encode stage 平面文件编码操作Flat File Encode action 将 XML 转换为平面文件Convert from XML to flat file
消息检查器Message Inspector Azure Functions 或 API 应用Azure Functions or API Apps 在集成中运行自定义代码Run custom code in your integrations
路由操作Route Action 条件或切换Condition or Switch 将消息路由到指定的连接器之一Route messages to one of the specified connectors

BizTalk 服务项目BizTalk Services artifacts

BizTalk 服务有几种类型的项目。BizTalk Services has several kinds of artifacts.

连接器Connectors

BizTalk 服务连接器帮助网桥发送和接收数据,包括启用了基于 HTTP 的请求/响应交互的双向网桥。BizTalk Services connectors help bridges send and receive data, including two-way bridges that enable HTTP-based request/response interactions. 逻辑应用使用相同的术语,并具有数百个连接器,这些连接器通过连接到各种技术和服务来达到相同的目的。Logic Apps uses the same terminology and has hundreds of connectors that serve the same purpose by connecting to a wide range of technologies and services. 例如,连接器可用于云 SaaS 和 PaaS 服务(例如 OneDrive、Office365、Dynamics CRM 及其他服务)并可通过本地数据网关用于本地系统,本地数据网关替代了 BizTalk 服务的 BizTalk 适配器服务。For example, connectors are available for cloud SaaS and PaaS services, such as OneDrive, Office365, Dynamics CRM, and more, plus on-premises systems through the On-Premises Data Gateway, which replaces the BizTalk Adapter Service for BizTalk Services. BizTalk 服务中的源仅限于 FTP、SFTP 和服务总线队列或主题订阅。Sources in BizTalk Services are limited to FTP, SFTP, and Service Bus Queue or Topic subscription.

默认情况下,每个网桥都有一个 HTTP 终结点,这是通过网桥的“运行时地址”和“相对地址”属性配置的。By default, each bridge has an HTTP endpoint, which is configured with the Runtime Address and the Relative Address properties for the bridge. 若要通过逻辑应用实现相同结果,请使用请求和响应操作。To achieve the same results with Logic Apps, use the Request and Response actions.

XML 处理和网桥XML processing and bridges

在 BizTalk 服务中,网桥类似于处理管道。In BizTalk Services, a bridge is analogous to a processing pipeline. 网桥可以获得从连接器接收的数据,对数据执行某些操作,然后将结果发送到另一个系统。A bridge can take data received from a connector, do some work with the data, and send the results to another system. 逻辑应用通过支持与 BizTalk 服务相同的基于管道的集成并提供其他集成模式来执行相同的操作。Logic Apps does the same by supporting the same pipeline-based interaction patterns as BizTalk Services and also providing other integration patterns. 在 BizTalk 服务中,XML 请求-答复网桥称为 VETER 管道,它包括执行以下任务的各个阶段:The XML Request-Reply Bridge in BizTalk Services is known as a VETER pipeline, which consists of stages that perform these tasks:

  • (V) 验证(V) Validate
  • (E) 扩充(E) Enrich
  • (T) 转换(T) Transform
  • (E) 扩充(E) Enrich
  • (R) 路由(R) Route

下图显示了处理在请求和答复之间的拆分情况,这允许分别对请求和答复路径进行控制,例如,通过为每个路径使用不同的映射:This image shows how processing is split between request and reply, which provides control over the request and the reply paths separately, for example, by using different maps for each path:

另外,XML 单向网桥还在处理开头和末尾添加了解码和编码阶段。Also, an XML One-Way bridge adds Decode and Encode stages at the start and end of processing. 直通网桥包含单个扩充阶段。The Pass-Through bridge contains a single Enrich stage.

消息处理、解码和编码Message processing, decoding, and encoding

在 BizTalk 服务中,可以接收不同类型的 XML 消息,并确定所接收消息的匹配架构。In BizTalk Services, you can receive different types of XML messages, and determine the matching schema for the message received. 此工作是在接收处理管道的“消息类型” 阶段执行的。This work is performed in the Message Types stage of the receive processing pipeline. 然后,解码阶段通过提供的架构,使用检测到的消息类型对消息进行解码。The Decode stage then uses the detected message type to decode the message using the provided schema. 如果架构为平面文件架构,则此阶段会将传入的平面文件转换为 XML。If the schema is a flat file schema, this stage converts the incoming flat file to XML.

逻辑应用提供类似的功能。Logic Apps provides similar capabilities. 你使用不同的连接器触发器通过不同的协议(文件系统、FTP、HTTP,等等)接收平面文件,并使用平面文件解码操作将传入的数据转换为 XML。You receive a flat file over different protocols using the different connector triggers (File System, FTP, HTTP, and so on), and use the Flat File Decode action to convert the incoming data to XML. 无需进行任何更改即可将现有的平面文件架构直接移动到逻辑应用,然后再将架构上传到集成帐户。You can move your existing flat file schemas directly to Logic Apps without any changes, and then upload schemas to your Integration Account.

验证Validation

传入数据转换为 XML后(或者如果接收到的消息格式为 XML),将运行验证以确定消息是否符合 XSD 架构。After the incoming data is converted to XML (or if XML was the message format received), validation runs to determine if the message adheres to your XSD schema. 若要在逻辑应用中执行此任务,请使用 XML 验证操作。To perform this task in Logic Apps, use the XML Validation action. 无需进行任何更改即可使用 BizTalk 服务中的相同架构。You can use the same schemas from BizTalk Services without any changes.

转换消息Transform messages

在 BizTalk 服务中,转换阶段将一种基于 XML 的消息格式转换为另一种格式。In BizTalk Services, the Transform stage converts one XML-based message format to another. 此工作是通过使用基于 TRFM 的映射程序来应用映射完成的。This work is done by applying a map, using the TRFM-based mapper. 在逻辑应用中,过程与此类似。In Logic Apps, the process is similar. 转换操作会从集成帐户执行映射。The Transform action executes a map from your Integration Account. 主要区别是,逻辑应用中的映射是 XSLT 格式。The main difference is that maps in Logic Apps are in XSLT format. XSLT 能够重复使用现有 XSLT,包括为 BizTalk Server 创建的包含 functoid 的映射。XSLT includes the ability to reuse existing XSLT you already have, including maps created for BizTalk Server that contain functoids.

路由规则Routing rules

BizTalk 服务会做出路由决策,决定由哪个终结点或连接器来发送传入的消息或数据。BizTalk Services makes a routing decision on which endpoint or connector to send incoming messages or data. 可以使用路由筛选器选项从预配置的终结点中进行选择:The ability to select from pre-configured endpoints is possible using the routing filter option:

在 BizTalk 服务中,如果只有两个选项,则使用“条件” 是用于转换 BizTalk 服务中的路由筛选器的最佳方式。In BizTalk Services, if there are only two options, using a condition is the best way for converting routing filters in BizTalk Services. 如果不止两个选项,则使用“切换” 。If there are more than two, then use a switch.

逻辑应用通过条件语句switch 语句提供更复杂的逻辑功能以及高级控制流和路由。Logic Apps provides sophisticated logic capabilities plus advanced control flow and routing with conditional statements and switch statements.

扩充Enrich

在 BizTalk 服务处理中,扩充阶段会向与接收的数据关联的消息上下文添加属性。In BizTalk Services processing, the Enrich stage adds properties to the message context associated with the data received. 例如,通过查找数据库提升要用于路由的属性,或者通过使用 XPath 表达式来提取值。For example, promoting a property to use for routing from a database lookup, or by extracting a value using an XPath expression. 逻辑应用将提供前面操作的所有上下文数据输出的访问权限,使复制相同的行为变得十分简单。Logic Apps provides access to all contextual data outputs from preceding actions, making it straightforward to replicate the same behavior. 例如,使用 Get Row SQL 连接操作,可从 SQL Server 数据库返回数据,并在决策操作中使用数据进行路由。For example, using the Get Row SQL connection action, you return data from a SQL Server database, and use the data in a Decision action for routing. 同样,触发器触发的传入服务总线队列消息的属性是可寻址的,使用 xpath 工作流定义语言表达式的 XPath 也是如此。Likewise, properties on incoming Service Bus queued messages by a trigger are addressable, as well as XPath using the xpath workflow definition language expression.

运行自定义代码Run custom code

BizTalk 服务允许你运行在你自己的程序集中上传的自定义代码BizTalk Services lets you run custom code that is uploaded in your own assemblies. 此功能是通过 IMessageInspector 接口实现的。This functionality is implemented by the IMessageInspector interface. 网桥中的每个阶段都包括两个属性(On Enter Inspector 和 On Exit Inspector),它们提供你创建的实现了此接口的 .NET 类型。Each stage in the bridge includes two properties (On Enter Inspector, and On Exit Inspector) that provide the .NET type you created that implements this interface. 通过自定义代码,可以对数据执行更复杂的处理,还可以重复使用程序集中执行常见业务逻辑的现有代码。Custom code lets you perform more complex processing on data and lets you reuse existing code in assemblies that perform common business logic.

逻辑应用提供两种主要方式来执行自定义代码:Azure Functions 和 API 应用。Logic Apps provides two primary ways to execute custom code: Azure Functions, and API Apps. 可以创建 Azure Functions,也可以从逻辑应用中调用。Azure Functions can be created, and called from logic apps. 请参阅通过 Azure Functions 为逻辑应用添加和运行自定义代码See Add and run custom code for logic apps through Azure Functions. 使用 API 应用(Azure 应用服务的一部分)创建自己的触发器和操作。Use API Apps, part of Azure App Service, to create your own triggers and actions. 了解有关创建用于逻辑应用的自定义 API 的详细信息。Learn more about creating a custom API to use with Logic Apps.

如果程序集中有从 BizTalk 服务中调用的自定义代码,可以将此代码移到 Azure Functions,也可以使用 API 应用创建自定义 API;具体取决于要实现什么。If you have custom code in assemblies that you call from BizTalk Services, you can either move this code to Azure Functions, or create custom APIs with API Apps, depending on what you're implementing. 例如,如果代码包装了逻辑应用没有其连接器的另一个服务,则请创建 API 应用,并在逻辑应用中使用你的 API 应用提供的操作。For example, if you have code that wraps another service for which Logic Apps doesn't have a connector, then create an API App, and use the actions your API app provides within your logic app. 如果有帮助程序函数或库,则 Azure Functions 很有可能是最合适的。If you have helper functions or libraries, then Azure Functions is likely the best fit.

EDI 处理和参与方管理EDI processing and trading partner management

BizTalk 服务和逻辑应用包括 EDI 和 B2B 处理,并支持 AS2(适用性语句 2)、X12 和 EDIFACT。BizTalk Services and Logic Apps include EDI and B2B processing with support for AS2 (Applicability Statement 2), X12, and EDIFACT. 在 BizTalk 服务中,需要在专用的跟踪和管理门户中创建 EDI 网桥以及创建或管理参与方和协议。In BizTalk Services, your create EDI bridges and create or manage trading partners and agreements in the dedicated Tracking and Management portal. 在逻辑应用中,此功能是通过 Enterprise Integration Pack (EIP) 实现的。In Logic Apps, you get this functionality through the Enterprise Integration Pack (EIP). EIP 提供了用于 EDI 和 B2B 处理的集成帐户和 B2B 操作。The EIP provides Integration Account and B2B actions for EDI and B2B processing. 还可以使用集成帐户来创建和管理参与方协议You also use an Integration Account to create and manage trading partners and agreements. 创建集成帐户后,可以将一个或多个逻辑应用链接到该帐户。After you create an Integration Account, you can link one or more logic apps to the account. 然后,可以使用 B2B 操作从逻辑应用访问参与方信息。You can then use B2B actions to access trading partner information from your logic app. 提供了以下操作:The following actions are provided:

  • AS2 编码AS2 Encode
  • AS2 解码AS2 Decode
  • X12 编码X12 Encode
  • X12 解码X12 Decode
  • EDIFACT 编码EDIFACT Encode
  • EDIFACT 解码EDIFACT Decode

与 BizTalk 服务不同,这些操作与传输协议无关。Unlike BizTalk Services, these actions are decoupled from the transport protocols. 因此,创建逻辑应用时,可以更加灵活地选择要使用哪个连接器来发送和接收数据。So when you create your logic apps, you have more flexibility in which connectors that you use to send and receive data. 例如,可以将电子邮件附件接收为 X12 文件,然后在逻辑应用中处理这些文件。For example, you can receive X12 files as attachments from email, and then process these files in a logic app.

管理和监视Manage and monitor

在 BizTalk 服务中,专用门户提供了跟踪功能来监视和解决问题。In BizTalk Services, a dedicated portal provided tracking capabilities to monitor and troubleshoot issues. 逻辑应用提供了更丰富的跟踪和监视功能来监视 Azure 门户中的逻辑应用,包括用于在移动时监视事物的一款移动应用。Logic Apps provides richer tracking and monitoring capabilities to monitor logic apps in the Azure portal, and includes a mobile app for keeping an eye on things when you're on the move.

高可用性High availability

若要在 BizTalk 服务中实现高可用性 (HA),可以通过在特定区域中使用多个实例来共享处理负载。For high availability (HA) in BizTalk Services, you can share the processing load by using more than one instance in a specific region. 逻辑应用提供区域中 HA 且不另外收费。Logic Apps provides in-region HA at no additional cost.

在 BizTalk 服务中,B2B 处理的区域外灾难恢复需要执行备份和还原过程。In BizTalk Services, out-of-region disaster recovery for B2B processing requires a backup and restore process. 为实现业务连续性,逻辑应用提供了跨区域主动/被动 DR 功能,这允许跨不同区域中的集成帐户来同步 B2B 数据。For business continuity, Logic Apps provides cross-region active/passive DR capability, which lets you synchronize B2B data across integration accounts in different regions.

后续步骤Next steps