Getting Started with Logic Apps - File Routing | Connect to On Premise File System with Logic App

{tocify} $title={Table of Contents}


The very first thing which comes in mind when starting with any Integration tool is to do couple of demo
1. How to route file from one location to another (File Routing)

In this post I intend to explore the way Logic app can be used in a scenario where only routing of files is required, also brief comparison with BizTalk File Adapter and some points to be noted.


  1. Azure subscription
  2. On Premises Data gateway (If not done already then follow -Installing and Configuring On Premises Data Gateway - By adding user to Active Directory)
Let’s start with designing the workflow:-

Why do we need on premise data gateway logic apps

Logic app when procured under consumption plan, has no fixed unlying infrastructure. It keeps adding servers as processing demand increases and removes
when demand decreases. 

Thus fixed set of IP addresses are not available which can be integrated with the on premise network.

So, we need a agent or mediator which can enable the communication without compromising on security.

The on premise data gateway works as a bridge that provides quick data transfer and encryption between data sources on premises and your logic apps. 

Behind the scene it uses Service bus relay, which actually opens outbound port and communication happens through it.

Create instance of Logic App

  •   Login to
  •   Create instance of Logic app, click on new and select Logic App
  •   Provide Name, select subscription, resource group and Location.
  •   Then select Blank Template and search for File Trigger
  •   For now there are couple of triggers available against File System
create Logic App

  •   Select the trigger type you are interested in, I have selected “when one or more files are added or modified”

  • First thing after selecting trigger is to create a connection, here we use On Premises data gateway (Connect via on-premise data gateway), thus Demo data gateway gets auto populated as it is already installed on the machine. Provide rest of the connection information.
create connection

  • After creating a connection we need to provide the Folder information, which Logic Apps needs to watch for
configure trigger

get file content action

  • Second action is to create file from the content and save it to destination folder with the same name and for that add an Action, Create File
create file action

That’s it. Logic app to route file from one folder to another folder which is on Premises is ready.


  • Created one sample xml and one text file in IN folder and both were routed to OUT folder- Logic app was triggered

Trigger successful testcase

Note: The files are not deleted from IN folder (In BizTalk, file adapter deletes the files, once it drops it in messagebox)

  • Modified the already existing file in IN folder and it was routed to OUT folder - the Logic app was triggered
  • When dropped already existing sample files nothing happened - the logic app wasn’t triggered(it was skipped)

Trigger skipped testcase

Note: It seems File System trigger looks at the timestamp as well- anything older than the Interval (where it looks for new or modified files) is ignored.

If there is any other way to implement this scenario in Logic apps, then would certainly love to hear from you.

If you have questions or suggestions, feel free to do in comments section below !!!

Do share if you find this helpful .......
                     Knowledge Sharing is Caring !!!!!!

Learn More about Logic App

Post a Comment

If you have any suggestions or questions or want to share something then please drop a comment

Previous Post Next Post