Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies to: Azure Logic Apps (Consumption + Standard)
When your workflow needs to perform automated, secure file management on servers that use the Secure Shell (SSH) File Transfer Protocol (SFTP), use the SFTP-SSH or SFTP connector operations in the workflows that you create with Azure Logic Apps.
SFTP is a network protocol that provides file access, file transfer, and file management over any reliable data stream. You can then monitor, transfer, and manage files on your SFTP server without writing custom code or managing infrastructure. Otherwise, trying to manually manage these file operations can be time-consuming, error-prone, and hard to scale.
For example, your workflow can complete the following tasks:
- Monitor and process incoming data files.
- Create and manage folders and files.
- Get file content and metadata. Extract archives.
- Distribute reports.
- Synchronize content across environments.
This guide shows how to access your SFTP server from a workflow in Azure Logic Apps.
For more information, see:
Connector technical reference
The SFTP-SSH connector has different versions, based on logic app type and host environment.
Consumption and Standard workflows can use the SFTP-SSH managed connector, which shares compute with other resources in multitenant Azure. Standard workflows can also use the runtime-native or built-in SFTP connector. Both connector versions use the SSH protocol.
| Logic app type (plan) | Environment | Connector version |
|---|---|---|
| Consumption | Multitenant Azure Logic Apps | Managed connector, which appears in the connector gallery under the Shared filter. For more information, see SFTP-SSH managed connector reference. |
| Standard | Single-tenant Azure Logic Apps, App Service Environment v3 (Windows plan only), and Hybrid | - Managed connector, which appears in the connector gallery under the Shared filter. - Built-in connector, which appears in the connector gallery under the Built in filter and is service provider-based. The built-in connector can directly connect to an SFTP server and access Azure virtual networks by using a connection string without an on-premises data gateway. For more information, see: - SFTP-SSH managed connector reference - SFTP built-in connector reference |
Different SFTP connector versions offer different prebuilt operations. You can start a blank workflow with an SFTP-specific trigger, or choose a different trigger, based on your scenario. For example, you can start your workflow with an SFTP trigger that monitors and responds to events on your SFTP server. The trigger provides outputs to use with subsequent actions in your workflow. Various SFTP actions perform different tasks, such as get, create, and manage files on your SFTP server.
Prerequisites
An Azure account and subscription. Get a free Azure account.
Information about your SFTP server connection and authentication:
- Server address
- Account credentials
- Access to an SSH private key
- SSH private key password
Important
When you create your connection and enter your SSH private key in the SSH private key parameter, make sure to follow the steps for providing the complete and correct parameter value. Otherwise, an invalid key causes the connection to fail.
For more information, see SFTP-SSH managed connector reference - Authentication and permissions.
The workflow where you want to access your SFTP server.
To start your workflow with an SFTP trigger, you need a blank workflow. To use an SFTP action, use any trigger that works best for your scenario. The example in this guide uses the Recurrence trigger.
General limitations
Before you use the SFTP-SSH managed connector, see SFTP-SSH managed connector reference - known issues and limitations.
Before you use the SFTP built-in connector, see SFTP built-in connector reference - known issues and limitations.
Known issues
By default, triggers that accept and return arrays usually have a Split on setting that's already enabled. The trigger automatically debatches an array by internally creating a separate workflow instance to process each array item. All the workflow instances run in parallel so that the array items are processed at the same time.
With the Split on setting enabled, managed connector triggers return the outputs for all the array items as lists. Any subsequent actions that reference these outputs must first handle these outputs as lists. To handle each array item individually, you can add extra actions. For example, to iterate through these array items, you can use a For each loop. For triggers that return only metadata or properties, use an action that gets the array item's metadata first, and then use an action to get the items contents.
You must apply this approach only for managed connector triggers, not built-in connector triggers that return outputs for one array item at a time with the Split on setting enabled.
For example, suppose you have managed connector trigger named When a file is added or modified (properties only) that returns the metadata or properties for the new or updated files as arrays. To get the metadata separately for each file, you might use a For each loop that iterates through the array. In this loop, use the following managed connector actions in the specified order:
Get file metadata to get each file's metadata.
Get file content action to get each file's content.
Chunking
Chunking lets an operation handle large files that exceed the default size limits. For more information about the SFTP-SSH managed connector and chunking support, see SFTP-SSH managed connector reference - Chunking.
Add an SFTP trigger
To add an SFTP trigger to your blank workflow, follow the corresponding steps:
Add a managed SFTP-SSH trigger (Consumption, Standard)
To add and set up a managed or shared SFTP-SSH connector trigger, follow these steps:
In the Azure portal, open the logic app resource. In the designer, open the blank workflow.
In the designer, follow the general steps to add the shared SFTP-SSH trigger you want.
For example, the SFTP-SSH trigger named When a file is added or modified starts the workflow when a file on your SFTP server is added or changed. You can add a condition action that checks whether the file content meets specified criteria. If the content meets the criteria, use the SFTP action named Get file content, and then use another action to save the content to a different SFTP folder.
If prompted, provide the necessary connection information. When you finish, select Create new.
On the designer, select the trigger, if not selected. In the trigger information pane, provide the necessary details.
For more information, see SFTP-SSH managed connector triggers reference.
When you finish, save your workflow. On the designer toolbar, select Save.
Continue building your workflow by adding actions.
Add a built-in SFTP trigger (Standard only)
To add and set up a built-in SFTP connector trigger, follow these steps:
In the Azure portal, open the logic app resource. In the designer, open the blank workflow.
In the designer, follow the general steps to add the built-in SFTP trigger you want.
For example, the SFTP trigger named When a file is added or modified starts the workflow when a file on your SFTP server is added or changed. You can add a condition action that checks whether the file content meets specified criteria. If the content meets the criteria, use the SFTP action named Get file content, and then use another action to save the content to a different SFTP folder.
If prompted, provide the necessary connection information. When you finish, select Create new.
On the designer, select the trigger, if not selected. In the trigger information pane, provide the necessary details.
For more information, see SFTP built-in connector trigger reference.
When you finish, save your workflow. On the designer toolbar, select Save.
Continue building your workflow by adding actions.
Add an SFTP action
Before you add an SFTP action, your workflow requires a trigger, which can be whatever works best for your scenario.
This example uses the generic Recurrence built-in trigger, which runs your workflow based a specified schedule. You can add an SFTP
Add a managed SFTP-SSH action (Consumption, Standard)
To add and set up a managed SFTP-SSH connector action, follow these steps:
In the Azure portal, open your logic app resource. In the designer, open your workflow.
In the designer, follow the general steps to add the shared SFTP-SSH action you want.
For example, the SFTP-SSH action named Get file content using path gets file content from an SFTP server by specifying the file path. You can use the SFTP-SSH trigger to check for new or updated files and a condition action that specifies criteria that the content must meet. If the content meets the criteria, use the Get file content using path action and a subsequent action to save the content to a different SFTP folder.
If prompted, provide the necessary connection information. When you finish, select Create new.
On the designer, select the action, if not selected. In the action information pane, provide the necessary details.
For more information, see SFTP-SSH managed connector actions reference.
When you finish, save your workflow. On the designer toolbar, select Save.
Add a built-in SFTP action (Standard only)
To add and set up a built-in SFTP action, follow these steps:
In the Azure portal, open your logic app resource. In the designer, open your workflow.
In the designer, follow the general steps to add the built-in SFTP-SSH action you want.
For example, the SFTP action named Get file content gets the file content on an SFTP server. You can use the SFTP trigger that checks for new or updated files and a condition action that specifies criteria that the file content must meet. If the content meets the criteria, use the Get file content action and a subsequent action to save the content to a different SFTP folder.
If prompted, provide the necessary connection information. When you finish, select Create new.
On the designer, select the action, if not selected. In the action information pane, provide the necessary details.
For more information, see SFTP built-in connector actions reference.
When you finish, save your workflow. On the designer toolbar, select Save.
Troubleshoot problems
For more information, see:
- SFTP-SSH managed connector reference - Troubleshooting
- SFTP built-in connector reference - Troubleshooting