Connecting Azure Logic App with on-premise BizTalk Server 2016

In this code sample, we will call on-premise WCF Service from Logic Apps through BizTalk Server 2016. Here, WCF Service is responsible for getting account details for a specific Sunny Electricals customer. We will use Consume WCF Service Wizard to generate XSD schemas for the WCF Service and generate an IIS endpoint for Logic App to trigger.

Connecting Azure Logic App with on-premise BizTalk Server 2016

This solution requires the following components to be installed and configured along with Microsoft BizTalk Server 2016:

  • On-premise data gateway
  • IIS configuration for Logic App Adapter
  • WCF-Basic HTTP adapter
  • Logic Apps Adapter

We have already discussed in Chapter 8, A Deep Dive into Logic Apps, how to install and configure an on-premise data gateway using your Azure subscription. We will use the on-premise data gateway along with BizTalk Server and Logic App Adapter to make the hybrid solution.

IIS configuration for Logic App Adapter

We assume that you have already installed and configured an on-premise data gateway on BizTalk Server, if not, you can refer to Chapter 8, A Deep Dive into Logic Apps, for the installation and configuration of on-premise data gateway. Once you are done with the on-premise data gateway, you need to set up and configure the Logic App IIS endpoint correctly to access BizTalk Server environment from logic through an on-premise data gateway.

The step-by-step documentation to configure IIS for Logic App Adapter is as follows:

  • Click on the Windows icon and type run to open up the Run command window. Type inetmgr in the search box and click on enter.
  • Create an IIS Application Pool by right-clicking the Application Pools and select new Application Pool. Enter the desired name LogicApp and click on ok to add a new IIS Application Pool.
  • In the Advanced Settings of newly created Application Pool, set the Identity property to the appropriate user who is a member of the BizTalk Server administrative group:

IIS configuration for Logic App Adapter

  • Next, right-click on Default Web Site and click on Add Application. In the dialog that opens, enter a name for the application as ManagementEndpoint, and for the physical path, enter the installation path of Logic App ManagementEndpoint. The default path will be C:Program Files (x86)Microsoft BizTalk Server 2016LogicApp AdapterManagement.
  • For the newly created Application ManagementEndpoint, change the IIS Application Pool to Application Pool created earlier.
  • Click on test Settings to confirm that the Application Pool identity passes the authentication and authorization tests.
  • Open a web browser and go to: http://localhost/ManagementEndpoint/Schemas?api-version=2016-10-26. This will give a list of schemas deployed in the BizTalk Server Management database.

IIS configuration for Logic App Adapter

Consuming a WCF Service in BizTalk 2016

We move ahead to create a BizTalk solution, which will call a WCF Service hosted within the corporate network. Create a Visual Studio BizTalk Project and use Add Generated Items | Consume WCF Service to generate XML schema for the WCF Service, which will return customer account details.

Consuming a WCF Service in BizTalk 2016

Enter the URL of the on-premise-hosted WCF Service to generate the WCF data contract, which will be used within the orchestration.

Consuming a WCF Service in BizTalk 2016

Create a simple orchestration, which will receive customerId as a request and call the WCF Service to get account customer information. All the logical ports in the orchestration are configured with a specify later binding. The solution containing the schemas and orchestration is signed with a strong name and deployed to the BizTalk runtime:

Consuming a WCF Service in BizTalk 2016

The configuration of the physical send and receive ports is done after the solution is deployed to the BizTalk Server administration console.

To create web port, import the binding file in the BizTalk solution, which is generated from the Add Generate Item. To create a request-response, receive a location for Logic Apps Create application within IIS for GetCustomerDetails and set the application poll same as of LogicApp Management Endpoint. Set the Application path for GetCustomerDetails to use C:Program Files (x86)Microsoft BizTalk Server 2016LogicApp AdapterReceiveService.

In the BizTalk Admin console, create a request response port within the GetCustomerDetails solution, which will run under the Logic App adapter handler. The configuration details are shown in the following image:

Consuming a WCF Service in BizTalk 2016

Consuming a WCF Service in BizTalk 2016

Creating a Logic App to call BizTalk

  • From the Azure portal, click on New, search for a Logic App, and click on Logic App.
  • Enter a Name, Subscription, Resource Group, and Location for your Logic App and then click on Create.
  • Once new logic is created, design the Logic App workflow with the HTTP trigger and BizTalk actions (create message from XML and send message) and HTTP response.

Creating a Logic App to call BizTalk

Once the Logic App design is completed and saved. Trigger the Logic App through the client application or any testing tool such as Postman.

Creating a Logic App to call BizTalk

We have used the Postman tool to make an HTTP post on created Logic App. The Logic App workflow calls to BizTalk endpoints through on-premise data gateway and gets the desired customer record into Logic Apps.

Creating a Logic App to call BizTalk

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset