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)
2. How to perform CRUD operation on database (Inserting data in On Premises SQL
Database using Logic Apps and Inserting Multiple Records In On Prem SQL Using Logic App)
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.
Prerequisite:
- Azure subscription
- 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:-
Create instance of Logic App
- Login to https://portal.Azure.com
- 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
- 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.
- After creating a connection we need to provide the Folder information, which Logic Apps needs to watch for
- You might face error, that file doesn’t exist while selecting folder (Check your request parameters to make sure the Path “” exists on your file system)
- Next we will be using two action from the available actions associated with File System Connector
- First action after the flow is triggered is to get content of file and for add an Action, Get File content
- 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
That’s it. Logic app to route file
from one folder to another folder which is on Premises is ready.
Testing
- Created one sample xml and
one text file in IN folder and
both were routed to OUT folder-
Logic app was triggered
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)
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.
No comments:
Post a Comment