Using Azure Automation With Logic Apps For SFTP Transfers

less than 1 minute read


One of the cool ways to use Azure Automation Hybrid Workers is to schedule them to do SFTP transfers. Here is how:

To Resolve:

  1. Follow the steps in Moving To Azure Automation to create an Azure Automation account linked to Github.

    • Ensure an Azure Files share is mounted as the service account user
    • Ensure that each of your hybrid workers have a static public IP
      • Also make sure all third party vendors that you want to SFTP files to have this IP whitelisted as many will require this.
  2. Next, create a Logic App with a recurrence trigger that starts the action Create Job

  3. Lastly, just create a .ps1 file in the /runbooks directory of your Azure Automation repo that:

    • Grabs a file from the mounted drive
    • Copies it to the Hybrid Worker’s local C drive to a temp folder
    • Uses the WinSCP dll to transfer the file to a third party
    • Example