將您的應用程式和解決方案從 BizTalk 服務遷移至 Azure Logic AppsMigrate your apps and solutions from BizTalk Services to Azure Logic Apps

Microsoft Azure BizTalk 服務 (MABS) 即將停用。Microsoft Azure BizTalk Services (MABS) is retiring. 若要將 MABS 整合解決方案移至 Azure Logic Apps,請遵循本文中的指引。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 App Service 混合式連線取代了 BizTalk 服務混合式連線。Azure App Service Hybrid Connections replaces BizTalk Services Hybrid Connections. 透過 Azure 入口網站,即可使用 Azure App Service 取得 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.

Logic Apps 會以 BizTalk 服務等項目中的所有相同功能取代 EAI 和 EDI 橋接器型整合。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 服務的功能對應至 Logic Apps。This table maps BizTalk Services capabilities to Logic Apps.

BizTalk 服務BizTalk Services Logic AppsLogic 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 AppsAzure Functions or API Apps 在您的整合中執行自訂程式碼Run custom code in your integrations
路由動作Route Action 條件或 SwitchCondition 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 使用相同的術語,而且有數百個連接器可透過連接到各種不同的技術和服務來提供相同的用途。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.

顯示 BizTalk 服務流程的圖表。

根據預設,每個橋接器預設有一個 HTTP 端點,並以橋接器的「執行階段位址」和「相對位址」屬性設定。By default, each bridge has an HTTP endpoint, which is configured with the Runtime Address and the Relative Address properties for the bridge. 若要使用 Logic Apps 達成相同結果,請使用要求和回應動作。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. Logic Apps 會藉由支援與 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 提供類似的功能。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. 您可以將現有的一般檔案結構描述直接移至 Logic Apps,而不需要進行任何變更,再將結構描述上傳至您的整合帳戶。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. 若要在 Logic Apps 中執行這項工作,請使用 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. 在 Logic Apps 中,此程序會很類似。In Logic Apps, the process is similar. 轉換動作會從您的整合帳戶執行對應。The Transform action executes a map from your Integration Account. 主要差異在於 Logic Apps 中的對應採用 XSLT 格式。The main difference is that maps in Logic Apps are in XSLT format. XSLT 可以重複使用您目前已有的 XSLT,包括針對 BizTalk Server 所建立且含有運算質的對應。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. 如果有兩個以上的選項,則使用 switchIf there are more than two, then use a switch.

Logic Apps 提供複雜的邏輯功能,以及具有條件式陳述式參數陳述式的進階控制流程和路由。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 可從上述動作存取所有關聯式資料輸出,因此您可以直接複寫相同的行為。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.

Logic Apps 提供兩個執行自訂程式碼的主要方法:Azure Functions 和 API Apps。Logic Apps provides two primary ways to execute custom code: Azure Functions, and API Apps. 您可以建立 Azure Functions,並從 Logic Apps 呼叫。Azure Functions can be created, and called from logic apps. 請參閱透過 Azure Functions 新增並執行適用於 Logic Apps 的自訂程式碼See Add and run custom code for logic apps through Azure Functions. 使用 Azure App Service 一部分的 API Apps,可建立您自己的觸發程序和動作。Use API Apps, part of Azure App Service, to create your own triggers and actions. 深入了解建立自訂 API 來與 Logic Apps 搭配使用Learn more about creating a custom API to use with Logic Apps.

如果您的組件中有從 BizTalk 服務呼叫的自訂程式碼,您可以將此程式碼移至 Azure Functions,或使用 API Apps 建立自訂 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. 例如,如果您有包裝其他服務的程式碼,且 Logic Apps 沒有該服務的連接器,請建立 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. 如果您有 Helper 函式或程式庫,則 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 服務和 Logic Apps 包含 EDI 和 B2B 處理,並支援 AS2 (Applicability Statement 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. 在 Logic Apps 中,您可以透過企業整合套件 (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. 因此當您建立 Logic Apps 時,您有更大的彈性來選擇要用來傳送及接收資料的連接器。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. Logic Apps 提供更豐富的追蹤和監視功能來監視 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. Logic Apps 提供區域中 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. 針對商務持續性,Logic Apps 提供跨區域主動/被動 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