Connecting to an On-Premise web service and file system from a Logic App

This Blog entry describes the Azure Integration approach to connect OnPremise Webservices using OnPremise Data Gateway, Azure Integration Logic Apps and Logic App Custom Connector. It also describes an approach to read files from OnPremise using Azure Integration.

UseCase : Azure Integration for OnPremise

Consuming OnPremise webservice in Azure integration service. There will be a number of cases where enterprises want to connect their OnPremise environments to the cloud and expose data via webservice. This blog describes a method to consume the on premise web service in Azure Logic Apps and also reading the files from the on premise file system.

Azure Gateway LogicApp:Connecting to an OnPremise webservice and file system from a Logic App

The components used are:

  • Custom webservice on onPrem
  • OnPremise Data Gateway
  • Logic Apps custom connector
  • Logic Apps

The onPremise webservice could be a REST or a WCF webservice. The communication between Ompremise and cloud happens using the OnPremise data gateway. Steps to configure and install a Data gateway has been described here.

Export Webservice collection using Postman for Azure Integration

We need to create a PostMan collection of our webservices for creating a custom Logic App connector. Detailed steps and additional information can be found here

  • In Postman, on the Builder tab, select the HTTP method, enter the request URL for the API endpoint, and select an authorization protocol, if any.
  • Enter key-value pairs for the request header. For common HTTP headers, you can select from the dropdown list.
    • Content-Type”application/json”
  • Enter content that you want to send in the request body. To check that the request works by getting a response back, choose Send.
  • Choose Save.
  • Under Save Request, provide a request name and a request description. The custom connector uses these values for the API operation summary and description.
Azure Gateway LogicApp: Showing the response from onPrem web service: Create Postman collection
  • Choose + Create Collection and provide a collection name. The custom connector uses this value when you call the API.
  • Above the response window, choose Save Response.
  • At the top of the app, provide a name for your example response, and choose Save Example.
  • Under Headers, hover over each header, and choose the X next to the header to remove it. Choose Save to save the collection again.
  • Choose the ellipsis (. . . .) next to the collection, then choose Export.
  • Choose the Collection v1 export format, choose Export, then browse to the location where you want to save the JSON file.
Azure Gateway LogicApp: Showing the response from onPrem web service: Create Postman collection

Detailed steps and additional information can be found here

Create an Azure Integration Custom Logic App Connector

  1. Log on to https://portal.azure.com/ with the account used for Gateway registration
  2. Select the correct Subscription and search for Logic Apps Custom Connector
Azure Gateway LogicApp: Showing the response from onPrem web service: Create Custom Logic App connector

3. Click on the Logic Apps Custom Connector and Click on ADD
4. Then fill in the following information: Correct Subscription, Resource group, Custom Connector name and location

Azure Gateway LogicApp: Showing the response from onPrem web service: Create Custom Logic App connector

5. Click Review + Create and then Click on Create
6. Once it is created, then Go to the Resource and click on Edit
The fill in the following information
API End Point: REST ( SOAP based on your service type)
Select Postman collection V1 and import the file downloaded
from Postman.
This will fill in the information such as description, scheme, hostname and base Url . Ensure the information is correct. If not edit them.
Ensure to select  “Connect via on premise data gateway” and optionally upload an image

Azure Gateway LogicApp: Showing the response from onPrem web service: Create Custom Logic App connector

7. Click on Security, then select then correct authentication scheme and click on the definition
8. Validate the definition and click on  “Update connector” 

Azure Gateway LogicApp: Showing the response from onPrem web service: Create Custom Logic App connector

Interact with an on-premise webservice in Azure Integration Logic App

  • Create A new Logic App with a start condition either with a scheduler or an HTTP trigger
  • Add an action and search for the custom connector, which would appear in the custom section
Azure Gateway LogicApp: Showing the response from onPrem web service: Select the OnPrem API connection
  • Select one of the actions from the custom connector. Each method in the webservice would appear as the actions here.
  • While selecting the action, this would bring up a dialog to create an API Connection required to communicate with the webservice. Then fill in the information such as
    Connection Name: A name to identify the API connection,
    Authentication Type : Auth type used by the web service
    Subscription: The subscription where Gateway is present
    Connection Gateway: Choose your on-premise gateway which you would want to use to connect to on-premise web service
    Then click on Create
Azure Gateway LogicApp: Showing the response from onPrem web service: Create the API connection
  • Enter the values required to call the web method.
Azure Gateway LogicApp: Showing the response from onPrem web service

Interact with an on-premise file system from Azure integration Logic Apps

  • Click on a new Action on the Logic app, search for “File System” and select any of the following action
Azure Gateway LogicApp: Showing the results from Onprem file system and response from onPrem web service: Select File system action
  • This would bring up a dialog to create an API connection to connect to the file system and Click on Create
Azure Gateway LogicApp: Showing the results from Onprem file system and response from onPrem web service: Create File system API connection
  • Click on save and then run it and the run should show the results from OnPremise webservice and the file system
Azure Gateway LogicApp: Showing the results from Onprem file system and response from onPrem web service

Published by Poojith Jain

Poojith Jain is an Azure Architect with good experience with software design and development. He has a thorough knowledge of Azure Integration and he is passionate about solving complex and challenging problems in the field of Azure

One thought on “Connecting to an On-Premise web service and file system from a Logic App

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: