Azure Logic Apps and HTTP Connector (Middleware Friday)

|  Posted: March 20, 2017  |  Categories: Middleware Friday

This blog post covers Episode 11 of Middleware Friday where Kent Weare talks about Azure Logic Apps and HTTP Connector. In this episode, Kent talks about the improvements to the HTTP Connector. The HTTP Connector has some new VERBS like (GET, PUT, PATCH, DELETE) in addition to existing POST and the introduction of Custom Relative Paths. This makes the connector more ‘RESTful’ and cleaner – being able to perform multiple operations on the endpoint. With these new VERBS, there are definitely advantages when it comes to API Management –

You can download the entire article as a PDF document.
Azure Logic Apps and HTTP Connector
  • Without these new VERBS (with only POST), the ability to perform caching  on GET requests was literally impossible. Therefore, every time a GET request had to be sent to the system to retrieve the information
  • There is no need to change/set the backend URL

The HTTP connector also supports Relative Paths that allows the user to standardize the configuration and treat Logic Apps as Resources.

Demo

To explain the changes to the HTTP Connector, Kent considered the following demo architecture. There will be a device(s) issuing POSTMAN requests to two different Logic Apps that will be exposed (using GET & DELETE). The Logic Apps will be connected to a SQL Azure database.

get and delete requests

HTTP GET

Let’s first create the first Logic App that will be exposed. The process to create a Logic App remains the same. Let’s start of with a HTTP Request Trigger. By default, you will be able to define a POST URL. To take a look at the newly added VERBS, click Show Advanced Options.

configuring http get

You will now see the Method with drop down where you will see the newly listed VERBS and the Relative Path.

request body json schema

For our demo, let’s use the GET method and define the Relative Path to our database (Person).

defining relative path to database

You will notice that once you save the Logic App, the HTTP GET URL will automatically get generated. Copy the URL as this is what we will be using in POSTMAN to trigger the request.

You can download the entire article as a PDF document.
Azure Logic Apps and HTTP Connector

Now that we are actually exposing a GET, you can actually provide Query parameters and then retrieve them. Let’s say, we give the ID of the record to be retrieved from the database. In the second step of the Logic App, let’s create the Get Rows SQL connector to retrieve the values from the database by defining the Filter query.

get rows sql connector

In the next couple of steps, we will create a Compose action and the HTTP Response action to generate the response. The Logic App will finally look as shown below.

create http response action

To execute this, open POSTMAN and provide the GET URL that you copied  from step 1 (in the Request trigger). Replace the ‘ID’ parameter with the ID of the person.

GET URL in POSTMAN

When you click Send, you will see the response coming back from the Azure SQL database with the details of the person matching the entered ID.

POSTMAN authorization code
/

HTTP DELETE

in the previous example, we will provide the path parameter (/Person/{ID}). By doing this, you will be able to access the path parameter in any other connector (in our case the Execute Stored Procedure connector). The complete Logic App will be as follows –

execute stored procedure

To execute this, open POSTMAN and provide the DELETE URL that you copied  from step 1 (in the Request trigger). Replace the ‘ID’ parameter with the ID of the person. Click Send and the record will be deleted from the database.

Community Content

Kent highlighted the wonderful effort from the community and pointed out on an Integration Monday session by Johan Hedberg on “Continuous Integration for Logic Apps using Team Foundation Team Services“.

Watch the video of this session

You can watch the video of this session on Azure Logic Apps and HTTP Connector below.

 

Feedback

You can give your feedback about Middleware Friday episodes, any special topic of interest, or any guest speaker whom you would like to see at Middleware Friday. Simply tweet at @MiddlewareFri or drop an email to middlewarefriday@gmail.com.

You can watch the Middleware Friday sessions here.

You can download the entire article as a PDF document.
Azure Logic Apps and HTTP Connector
Author: Sriram Hariharan

Sriram Hariharan is the Senior Technical and Content Writer at BizTalk360. He has over 9 years of experience working as documentation specialist for different products and domains. Writing is his passion and he believes in the following quote - “As wings are for an aircraft, a technical document is for a product — be it a product document, user guide, or release notes”.

One Platform Operations, Monitoring and Analytics Software
BizTalk360

microsoft biztalk

Learn more

Over 500 customers across 30+ countries depend on BizTalk360

ServiceBus360

Azure service bus

Learn more

Start managing your Azure Service Bus namespaces in minutes

One Platform - Operations, Monitoring and Analytics Software
BizTalk360

microsoft biztalk

Learn more

Over 500 customers across 30+ countries depend on BizTalk360

One Platform - Operations, Monitoring and Analytics Software
ServiceBus360

Azure service bus

Learn more

Start managing your Azure Service Bus namespaces in minutes

Back to Top