11
Introduction This whitepaper provides information on how to create Azure logic app for xml transformation. This app will pick up the source xml from on premise directory, convert xml to another format and put that xml into another on premise directory. For me that was the first step, but in a real BizTalk scenario there at least has to be one map! My scenario is to read from my local laptop ‘inbox’ folder, transform the message and write to the same laptop to an ‘output’ folder. Components Required Below are the software and components for creating the Sample Visual Studio 2012. Windows Azure BizTalk Services SDK Azure Subscription. Step by Step Create Service Bus namespace on Azure portal. Create and configure File connector API to connect local on premise directory with Azure. Create Schema and Map required to transform XML format. Create BizTalk Transformation API and upload created map in API Test Azure Logical Transformation App. Create ServiceBus namespace We need to create Azure Service Bus namespaces, since it’s required for configuring file connector. File connector under the hood uses the Service Bus Relay technology to connect to the on premise environment. Service Bus namespace can be created from the old portal.

Introduction - gallery.technet.microsoft.com€¦  · Web viewFor me that was the first step, but in a real BizTalk scenario there at least has to be one map! My scenario is to read

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Introduction - gallery.technet.microsoft.com€¦  · Web viewFor me that was the first step, but in a real BizTalk scenario there at least has to be one map! My scenario is to read

Introduction This whitepaper provides information on how to create Azure logic app for xml transformation.

This app will pick up the source xml from on premise directory, convert xml to another format and put that xml into another on premise directory.

For me that was the first step, but in a real BizTalk scenario there at least has to be one map! My scenario is to read from my local laptop ‘inbox’ folder, transform the message and write to the same laptop to an ‘output’ folder.

Components RequiredBelow are the software and components for creating the Sample

Visual Studio 2012. Windows Azure BizTalk Services SDK Azure Subscription.

Step by Step Create Service Bus namespace on Azure portal. Create and configure File connector API to connect local on premise directory with Azure. Create Schema and Map required to transform XML format. Create BizTalk Transformation API and upload created map in API Test Azure Logical Transformation App.

Create ServiceBus namespace

We need to create Azure Service Bus namespaces, since it’s required for configuring file connector. File connector under the hood uses the Service Bus Relay technology to connect to the on premise environment.

Service Bus namespace can be created from the old portal.

Page 2: Introduction - gallery.technet.microsoft.com€¦  · Web viewFor me that was the first step, but in a real BizTalk scenario there at least has to be one map! My scenario is to read

You can copy the connection string of the service bus from the connection information, which is required for configuring the File connector.

Create and Configure File connector for DirectoryCreate File Connector to connect with on premise local directory.

Goto Marketplace->Api Apps->File Connector.

Name: SharedDriveAFileConnector.

Roor Folder: D:\Azure\ShareDriveA

Page 3: Introduction - gallery.technet.microsoft.com€¦  · Web viewFor me that was the first step, but in a real BizTalk scenario there at least has to be one map! My scenario is to read

Service Bus Connection String: copied from the Service bus connection information.

Once you click the create button, it will take about a minute to provision the File connector (API App), before you can use it in your solution (Azure Logic App). You need to repeat the above steps to configure the second File connector to the destination location,

Goto Marketplace->Api Apps->File Connector.

Name: SharedDriveBFileConnector.

Roor Folder: D:\Azure\ShareDriveB

Service Bus Connection String: copied from the Service bus connection information.

Page 4: Introduction - gallery.technet.microsoft.com€¦  · Web viewFor me that was the first step, but in a real BizTalk scenario there at least has to be one map! My scenario is to read

As you can notice there is a warning sign in the blade showing “Hybrid Connection – On Premise Setup Incomplete”, just click on that box, which will open up “Hybrid Connection” blade. You will see a link labelled ON-PREMISES HYBRID CONNECTION MANAGER “Download and configure”, clicking on that will download the on-premise agent file. Copy that file to the server where you’ll have your folder location, and start installing it (internet connection is required of course), the installer will ask for service bus relay connection string as shown below

Page 5: Introduction - gallery.technet.microsoft.com€¦  · Web viewFor me that was the first step, but in a real BizTalk scenario there at least has to be one map! My scenario is to read

Once you provide that information and completed the installation procedure, leave few seconds and check back on the File Connector blade, it should now show the connection successfully established as shown below.

Create BizTalk Transformation APIWe have to transform one XML to another so we will use BizTalk Transform API and use into our logic app.

Again go to the Azure Marketplace, search for “BizTalk Transform service” and create a new instance. Steps for creating the BizTalk Transform service is straight forward and doesn’t need any hybrid connection step up.

Page 6: Introduction - gallery.technet.microsoft.com€¦  · Web viewFor me that was the first step, but in a real BizTalk scenario there at least has to be one map! My scenario is to read

Once API created we can add map into the service.

Page 7: Introduction - gallery.technet.microsoft.com€¦  · Web viewFor me that was the first step, but in a real BizTalk scenario there at least has to be one map! My scenario is to read

Create BizTalk Schema and Map Create the BizTalk Schema and Map in Visual Studio 2012.

1. Create Input Schema

2. Create Output Schema

3. Create Map for transformation.

Page 8: Introduction - gallery.technet.microsoft.com€¦  · Web viewFor me that was the first step, but in a real BizTalk scenario there at least has to be one map! My scenario is to read

4. Upload Map into the BizTalk Transformation Service API App.

Create Azure Logic AppGoto Azure portal

New-> Logic Apps->Logic App->

Page 9: Introduction - gallery.technet.microsoft.com€¦  · Web viewFor me that was the first step, but in a real BizTalk scenario there at least has to be one map! My scenario is to read

Name: AzureTransformationApp

Click on Trigger and Action

Configure BizTalk Transformation Service.

Configure File Connector.

Test the Application 1: Drop the input file at source location.

2: Check the target location

Page 10: Introduction - gallery.technet.microsoft.com€¦  · Web viewFor me that was the first step, but in a real BizTalk scenario there at least has to be one map! My scenario is to read

Input:<ns0:PO xmlns:ns0="http://HelloWorld.POSchema"> <PO_Number>PO_Number</PO_Number> <Total>10</Total></ns0:PO>

Output:<?xml version="1.0" encoding="utf-8"?><ns1:Invoice xmlns:ns0="http://HelloWorld.POSchema" xmlns:ns1="http://HelloWorld.InvoiceSchema"> <Number>PO_Number</Number> <TotalPrice>10</TotalPrice></ns1:Invoice>

You can check the status of runs from the dashboard.

Possible Error How to Check Errors in Azure Logic Apps:Go to Logic App.

Click on Trigger History

Page 11: Introduction - gallery.technet.microsoft.com€¦  · Web viewFor me that was the first step, but in a real BizTalk scenario there at least has to be one map! My scenario is to read

Error “duplicate collection entry”: Error Statement: Cannot add duplicate collection entry of type 'mimeMap' with unique key attribute 'fileExtension' set to '.json'

Solution: Remove the mimeMap tag from IIS service which was created for File Connector

<staticContent> <mimeMap fileExtension=".json" mimeType="application/json" /> </staticContent>

Error “Access Denied”:Check access of folder location.