How To Store File In SFTP Using Azure Logic App

These articles will help you to understand how to use logic apps connector. I am also providing an example to create a file in SFTP location using SFTP connector in the logic app by executing step by step approach. Let’s gear up.

Introduction

If you are not aware of the Azure cloud and what is a logic app, then go through the details of it in my previous articles,

  1. An Overview of Cloud And Azure Cloud
  2. Pillars of Cloud And Azure Services
  3. Logic app overview

In this article, we will explore the SFTP connector and how to create a file in SFTP location using the Azure logic app.

Scenario

These articles will help you to understand how to use logic apps connector. I am also providing an example to create a file in SFTP location using SFTP connector in the logic app by executing step by step approach. Let’s gear up.

Pre-requisite 

  • Basic knowledge Azure services
  • SFTP location should be publicly available over the connector with credentials

 

Background

  • Case 1- If we need to create and store the file in FTP location
  • Case 2- If your cloud application must integrate with on-premise data sources but you do not want to directly expose and connect with the destination data source, then there should be one middle layer like FTP files etc. which will act as a bridge between the cloud app and on-premise data source. Cloud application will put the file in FTP location and then your on-premise data source will pick up the file, parse it and store the data in data source.

    (I am picking one example as FTP to explain the logic app connector, there are other approaches that can be used based on the requirement)

Details

Now, build a logic app to store the file in SFTP per five minutes,

How To Store File In SFTP Using Azure Logic App 

Step 1

Sign in to the Azure portal with your Azure account credentials.

Step 2

Click on ‘Create Source’ link, then navigate to the integration section and select ‘logic app’

How To Store File In SFTP Using Azure Logic App 

Step 3

Fill in details of a logic app like name, its resource group, location etc. and click on create a button.

How To Store File In SFTP Using Azure Logic App 

Step 4

Portal creates and deploys the logic app, once it is deployed then click on go to resource link as shown in the below screenshot,

How To Store File In SFTP Using Azure Logic App 

Step 5

Click on the edit button,

How To Store File In SFTP Using Azure Logic App 

Step 6

System will open the logic app designer window on which you will see the list of templates and connectors to build workflows quickly or we can create it from a blank.

I am selecting ‘recurrence’ because I want to run my logic app every five minutes at the background,

How To Store File In SFTP Using Azure Logic App 

Step 7

Enter interval as ‘5’ minutes. We can configure this at a point of time later as well based on the frequency.

How To Store File In SFTP Using Azure Logic App 

Frequency options

How To Store File In SFTP Using Azure Logic App 

Step 8

Click on the new step to add a new action in the logic app. Then, search for SFTP and select ‘Create file’ action,

How To Store File In SFTP Using Azure Logic App 

Step 9

Now, the system prompts to enter details about SFTP connection. At the backend system creates conection to SFTP by using the filled details.

Enter connection name (can be a user friendly name), host server address and username and password (password is not required if SFTP anonymous access is enabled)

Note
SFTP should be public and accessible over the internet.

How To Store File In SFTP Using Azure Logic App 

Step 10

After successful creation of the connection to SFTP then system asks you to enter the details about destination folder, file name and file content.

 

  • Folder
    You can use the explorer to browse your destination folder.

  • File Name
    You can use dynamic properties or a static name.

  • File Content
    You can create dynamic content or use static content as per need.

 

How To Store File In SFTP Using Azure Logic App 

Step 11

Now your logic app workflow is ready to use. You can save the logic app now or run for testing the newly created logic app,

How To Store File In SFTP Using Azure Logic App 

Now, every five minutes a file will be generated at SFTP location.

Summary

In this article, we have seen how to create a logic app connection and how to create a file in SFTP location using the SFTP connection.