Quick SFTP Server for Logic Apps

Oguzhan YIGIT
Published by Oguzhan YIGIT
Category : Azure / Logic Apps
12/02/2018

In this post, we will see how to configure a quick SFTP Server inside an Azure virtual machine and use it in any Azure Logic apps.

For one of our customer i was in charge of an integration process through SFTP. So, while developing the integration flow, i was in need of a SFTP Server for testing purpose. As the SFTP connection was not really my main challenge, i wanted something quick, free and easy to configure.

Choose and configure your SFTP Server

After googling “Free SFTP Server”, i randomly choosed Rebex tiny sftp server.

Guess how i’am lucky this time ! It’s a server built with .Net Framework. Plus it’s really easy to configure. Just unzip the downloaded package and if you are familiar with Microsoft technologies and Microsoft.Net Framework, you will quickly recognize the application configuration file. Open it and locate the “userName”, “userPassword” and “userRootDir” properties (I personnally haven’t played with other options as it was only for testing purpose). Specify the configuration properties you want to use (root directory is based under the unzipped folder location).

Rebex SFTP Server configuration

Enable SFTP communication on virtual machine and Azure portal

Once our SFTP server is configured we need to enable Port 22 (default SFTP port) to allow SFTP communications:

  • by enabling port 22 through Windows firewall (using the control panel section from your virtual machine)
  • by enabling port 22 on the “Networking” tab from the Azure portal

To enable port 22 on Azure portal, use the Networking tab under your virtual machine settings page.

enable port 22 for Azure virtual machine

 

From here, add an inbound and outbound port rule to enable your Azure virtual machine to be reached from port 22.

Well of course if your virtual machine is under a load balancer, you should:

  • enable port 22 on Windows firewall
  • use “inbound NAT rule” tabs from your load balancer settings page through Azure web portal. From there, add a rule to enable port 22 and redirect queries to your virtual machine

azure load balancer inbound nat rule

 

Don’t forget to start the SFTP server by double clicking on the executable file you downloaded and press “Start button”. Now everything is up to test your logic app !

Connect your logic app to your SFTP Server

While you sets your SFTP connector in your Azure logic, make sure you have checked the Disable Host Key validation to skip validation step because we haven’t specified any key.

azure logic app sftp shape configuration