Soap Connector in Logic Apps (Passthrough)

 

We usually have the requirement to leverage an existing soap service sitting on premises using Azure logic apps. I also came across such requirements in one of the projects. So how I did it, details are below:

I have created this as a passthrough connector for just to re-use existing request messaging payloads, intention to simulate the soap service call and try not to do anything fancy.

  1. Create a logic app custom connector with pass through option.
  • Login to Azure portal and create a new logic app custom connector with the name of your soap service.


  • Now go to the just created logic app custom connector and click edit.

General section


  • You can upload connector icon of your choice, which will be displayed when used in logic apps.
  • Make sure you select the ‘Connect-via on-premises data gateway’ option if the the soap service is deployed in an on-premise server/private network.
  • Now lets suppose, the Url of your soap service is like this http://10.1.0.91/training/apps/data.svc.
  • Then Host must be 10.1.0.91, which is the IP address of the server where the soap service sits.
  • then the Base url in the connector should be /training/apps (exclude data.svc part for now)
  • go to next page which is security.

Security section

Skip this step if your soap service has a separate login call to get the session token or authorization token. Otherwise, select the right authentication option that your soap service needs.

Definition section


  • When you configure this section, I would recommend you go directly to the swagger editor option, enable it and copy the below code (also, verify the highlighted fields below according to your soap service parameters):


 

 

 

 

 

 

 

  • Click on Update Connector.

2. Create logic app and test.

  • Create a new logic app to test the connector.
  • Add an action in the logic app and search by the connector name:


  • Select the SoapPassThrough action
  • The connection will be created, if authentication is selected , then it will ask for the details.
  • Now in the body section, just copy the request body of the soap.


  • Save and run the logic app to test.

Using regular expressions using JavaScript inline code action in logic apps

Hi Folks,

With this new feature of Azure logic apps called execute inline JavaScript code, I am trying to validate an email using regular expression in the request content. Let’s see:

This is the action I am talking about:

Steps:

  1. First create and link your integration account to the logic app. Read more about integration account, read more on https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-enterprise-integration-create-integration-account
  2. My Logic App Designer:

  3. Logic App Code:

  4. Sample Request and Response:
Request type Request Response
Valid Email

{

“FirstName”:”Sovit”,

“LastName”:”Charak”,

“Email”:”sovit.charak@gmail.com”

}

true
Invalid Email

{

“FirstName”:”Sovit”,

“LastName”:”Charak”,

“Email”:”sovit.charak_gmail.com”

}

false

 

Any questions, please leave them in the comments section.

Why Customer would need ISE (integration service environment)

It has been a month that the ISE offering from Microsoft’s logic app team is out in the market for public preview and a lot of my customers are asking me to go for it or not. I have advised them based on some factors which I am also going to discuss on this blog post. But first, let’s understand what ISE is.

The above diagram will explain a lot about ISE and it is also one of the example of high level architecture that I usually recommend, when you are going for ISE.

Definition

In simple words, ISE is a dedicated environment to run the logic apps and this environment is guarded under a network with virtual network configuration capabilities in it. Read more

Why to choose:

  • Growing Middleware cost and requirements to shift to fixed price model.
  • More control on logic app’s environment scalability, own custom domain and network configurations.
  • Stop public access of logic apps.
  • Need direct and fast access to on-premise resources. In that case, ISE network configuration can leverage express route.
  • Simplify and minimising use of custom logic app connectors to access on- premise resources.
  • Secure the integration account containing Schemas, Maps, EDI-Partner agreements from public access.
  • Isolated environment to solve noisy neighbour problem. Where in a shared environment there is a possibility of one service impacting others. Read more about this problem.

Why not to choose:

  • If you are currently happy with what you have and don’t have above pressing needs or problems.
  • You will lose the benefits that a consumption plan offers like pay as you go and auto scale. If your integration requirements are very limited, then it is wise to do not go for ISE.
  • Not available for production use yet. I am not sure about when it is going to be available but what I heard, it’s going to be available soon in few months (I hate this line). But if you are in rush and must go-live soon then go for public offering of logic apps.

Pricing

  • The price for base unit, which includes standard integration account and one enterprise connector will cost around $3327 AUD monthly.
  • But one can scale up the base unit to three additional units by paying extra $1667 AUD monthly. This is only required in some specific scenarios
Please leave your comments below if you need any assistance with ISE  related queries.

Add HTTP Headers with basic authorization in logic apps

Hi Readers,

I have come across a situation where I had to use header with basic-authentication and few others custom key-values to make a http call and get data. It’s very simple, let’s try this:

  1. You need to put the header’s key value pairs in a json format, for e.g.

Key-Value

Json Format

Content-Type: application/json

{“Content-Type”: “application/json”}

Content-Type: application/json

Host: prod-05.westus.logic.azure.com:443

{“Content-Type”: “application/json”,

“Host”:”prod-05.westus.logic.azure.com:443″}

 

  1. Now we will use same above format of headers in Json format to make a http request to an API using logic apps:

  2. See the code-view window as well:

  1. Keep adding your other headers also in the same json format as we did in step 3 for “Authorization” and “Content-Type”.

     

Xml Parsing in Logic Apps

Hi Readers,

Logic apps enforces json based message data processing, you can relate this concept with the BizTalk Server where xml based data processing standards are being enforced:

Applications Data Processing Standard
BizTalk XML
Logic Apps JSON

In BizTalk, it is very easy to parse json data into xml. There is a built-in pipeline available in Microsoft BizTalk Server 2013 Edition to implement this, but it gets tricky when you have to do the similar thing in a logic app. I am going to show you an example on how to parse json data into xml in logic apps…

  • In my example, I have created a custom API, which returns a list of employee names in a form of json data.

  • My objective is to create a text file in a blob container with a name of “Sovit.txt” and it should contain the data in the xml form of the above employee names, using a Logic App.

  • It took a fair amount of time to figure out how to do this and I am sharing this with you to save your precious time.
  • I have created a logic app with a name of TestEmployeeApp and it has three easy steps:

  • First step is a manual trigger, which I will be using to call/trigger this logic app, manually. Second step is an action, that calls a custom api, which returns the employee names data in Json. Third and final step is an action, which will create a file in a Blob container.
  • Note: that I have used predefined xml function of WDL, to parse json data into xml.
  • Note: In function xml (), you can only give one json property at a time. Multiple json objects or json object with multiple properties cannot be converted in a single go.
  • I had three employees to parse, so let’s see how I did it.

  • The above image is the third step of my logic app, I have created xml data with a root node of “Data” along with the concatenation of xml result of each json object one by one. Please see the highlighted code above.
  • ‘concat’ is a string function used to combine all the string values together.
  • Note: in the xml function, the input parameter is the single json object from the body of the action ‘Employee_Get’.
  • I have used the xml function thrice because I had three json objects to parse. If you have multiple json objects, you can use ‘forEach’ loop to loop over and convert each item to xml using the xml function.
  • Finally, I have assigned the output xml data to the body of the action, which creates a file in the blob container with the name “sovit.txt”, See the picture above.
  • You can download the complete code through this link http://sovitstorage.blob.core.windows.net/logicappcode/EmployeeXmlParse.txt.
  • Let me know if you are facing any issues with xml parsing in logic apps and BizTalk.

API Apps or Connectors are not appearing in Logic App Designer

Problem Statement:

  1. When we create our own API apps/connectors to use them into a logic app, we usually face a problem where we can can’t see them and use them into our logic apps and you see the empty list like I am seeing here:


  2. Now after bit of research, I found an easy two step resolution to this problem
  3. We have to tweak a bit in the settings of the App/Connector created which we want to use it in logic app. Please note that API apps are the part of Web apps now which means you need to deploy your Apps as Web apps and then they can be used in Logic apps.

Solution:

  1. I have created my Web App with the name “MoqTestAzureWebApi” and first step is to put Swagger 2.0 metadata in the API Definition of the app settings (Note that you will get the swagger metadata after adding the swagger(SwashBuckle) in your application):

               Yellow Highlighted is Swagger metadata 2.0 url

                 Browse to Web App Setting in Azure portal

`

          Paste here the swagger metadata URL generated in step 1

2. Change the endpoint from http to https and save the changes.

3. Second and last step is to enable CORS in the settings – CORS provides a secure way to allow one domain (the origin domain) to call APIs in another domain. see all the screenshots below:

4. In the Allowed Origins box, enter * and save it.

Value should be an asterisk and save it

5. Now if you try to use the API app in your Logic app, it should be available now: