Introduction

Logic Apps provide a powerful way to quickly integrate enterprise applications and services both on and off the cloud. To achieve this, it provides many off-the-shelf triggers and actions to facilitate a powerful integration workflow. Also, with Functions and other Azure services like API Management, Relays, Service Bus etc. it allows the integration solution to become multi-faceted and robust.

A genuine integration scenario for any enterprise is the requirement to connect to their on-premise resources. Over a period of time, BizTalk server has proved that it’s one of a great on-premise integration option for varieties of integration requirements and in this post, I am presenting one of the integration patterns for this type of hybrid integration.

Although there are various ways where on-premise BizTalk can be connected to cloud, I am just presenting one pattern of using new adapter added in BizTalk 2016 feature pack 3 “Office 365 Outlook Email adapter”. Comparison of On-premise vs cloud is outside the scope of this article.

Scenario


Setup 1: Logic App

Nothing fancy about it. It’s a simple Logic App to push an email to outlook.

  1. Login to Azure Portal
  2. Create a logic App; “SendToBizTalkOutlookAdapter”
  3. Sample JSON
{
"Name": "Sam Thomas",
"Age" : "42",
"Address" : {
"AddressLine1" : "24 Gateway Ave",
"AddressLine2" : "Rompy Lane",
"City" : "Dallas",
"State" : "TX",
"Zip5" : "12345"
},
"Salary" : "$103000"
}


Setup 2: Outlook Folder Rule:

I see “Move email” is in the preview. I will try that later and update the article


Setup 3: BizTalk Adapter Installation

Please follow:

https://docs.microsoft.com/en-us/biztalk/core/office365-adapters#tms-overview

a.Install BizTalk Server 2016 Feature Pack 3
b. Install BizTalk Server TMS: VERY IMPORTANT

If TMS is not installed; Adapter will not allow you to sign in and just the below error is logged in the event viewer

SSO AUDIT

 Function: GetConfigInfo (6af6e402-fd7c-43de-923a-d6f62ba300cd)

 Tracking ID: f378d2ab-4eb4-406f-b390-c0f5fd9c9c31

 Client Computer: DESKTOP (mmc.exe:2323232)

 Client User: DESKTOP\ASNSDDS

 Application Name: 13f3c6e3-46af-4775-a7de-406a3c2bcab1

 Error Code: 0xC0002A04, The application does not exist.


Step 4: BizTalk Receive Adapter

The following properties from the Receive Pipeline are promoted by default: 

Property Name

Promoted Property

Importance

OfficeMail.ReceivedMailImportance

Subject

OfficeMail.ReceivedMailSubject

SenderName

OfficeMail.SenderName

SenderAddress

OfficeMail.SenderAddress

HasAttachments

OfficeMail.HasAttachments

Important Note: Only the body content of the Email is passed through to the message.



Step 5: Send Port Configuration

Important Note: You can only send plain text messages using the send adapter.

a.       To send it to Gmail 


END TO END TESTING

  • Used Postman to push the test JSON message to the logic apps.
  • The message is then sent as an email to the Inbox.
  • An outlook business rule pushes the message to the “BizTalkOutlookAdapter” folder


  • BizTalk Receive Location using “Office365 Outlook Email Receive Adapter” reads the message from the “BizTalkOutlookAdapter” folder and also deletes it after reading.
  • The message is received in BizTalk and pushed to a file location by FileAdapter.
  • Copy of the same message is pushed to Gmail using “Office365 Outlook Email Send Adapter”