title | description | services | ms.suite | ms.reviewer | ms.topic | ms.date |
---|---|---|---|---|---|---|
Connect to an SFTP server from workflows |
Connect to your SFTP file server from workflows using Azure Logic Apps. |
logic-apps |
integration |
estfan, azla |
how-to |
05/10/2024 |
[!INCLUDE logic-apps-sku-consumption-standard]
This how-to guide shows how to access your SSH File Transfer Protocol (SFTP) server from a workflow in Azure Logic Apps. SFTP is a network protocol that provides file access, file transfer, and file management over any reliable data stream and uses the Secure Shell (SSH) protocol.
In Consumption logic app workflows, you can use the SFTP-SSH managed connector, while in Standard logic app workflows, you can use the SFTP built-in connector or the SFTP-SSH managed connector. You can use these connector operations to create automated workflows that run when triggered by events in your SFTP server or in other systems and run actions to manage files on your SFTP server. Both the managed and built-in connectors use the SSH protocol.
Note
The SFTP managed connector has been deprecated, so this connector's operations no longer appear in the workflow designer.
For example, your workflow can start with an SFTP trigger that monitors and responds to events on your SFTP server. The trigger makes the outputs available to subsequent actions in your workflow. Your workflow can run SFTP actions that get, create, and manage files through your SFTP server account. The following list includes more example tasks:
- Monitor when files are added or changed.
- Get, create, copy, rename, update, list, and delete files.
- Create folders.
- Get file content and metadata.
- Extract archives to folders.
The following steps use the Azure portal, but with the appropriate Azure Logic Apps extension, you can also use the following tools to create and edit logic app workflows:
-
Consumption logic app workflows: Visual Studio or Visual Studio Code
-
Standard logic app workflows: Visual Studio Code
The SFTP connector has different versions, based on logic app type and host environment.
Logic app type (plan) | Environment | Connector version |
---|---|---|
Consumption | Multi-tenant Azure Logic Apps | Managed connector, which appears in the designer under the Standard label. For more information, review the following documentation: - SFTP-SSH managed connector reference - Managed connectors in Azure Logic Apps |
Consumption | Integration service environment (ISE) | Managed connector, which appears in the designer under the Standard label, and the ISE version, which appears in the designer with the ISE label and has different message limits than the managed connector. For more information, review the following documentation: - SFTP-SSH managed connector reference - ISE message limits - Managed connectors in Azure Logic Apps |
Standard | Single-tenant Azure Logic Apps and App Service Environment v3 (Windows plans only) | Managed connector, which appears in the connector gallery under Runtime > Shared, and the built-in connector, which appears in the connector gallery under Runtime > In-App 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, review the following documentation: - SFTP-SSH managed connector reference - SFTP built-in connector reference - Managed connectors in Azure Logic Apps - Built-in connectors in Azure Logic Apps |
-
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.
[!INCLUDE Managed connector trigger "Split On" setting issue]
For more information about how the SFTP-SSH managed connector can handle large files exceeding default size limits, see SFTP-SSH managed connector reference - Chunking.
-
An Azure account and subscription. If you don't have an Azure subscription, sign up for a free Azure account.
-
Connection and authentication information to access your SFTP server, such as the server address, account credentials, access to an SSH private key, and the SSH private key password. For more information, see SFTP-SSH managed connector reference - Authentication and permissions.
[!IMPORTANT]
When you create your connection and enter your SSH private key in the SSH private key property, make sure to follow the steps for providing the complete and correct value for this property. Otherwise, a non-valid key causes the connection to fail.
-
The logic app workflow where you want to access your SFTP account. To start with an SFTP-SSH trigger, you have to start with a blank workflow. To use an SFTP-SSH action, start your workflow with another trigger, such as the Recurrence trigger.
-
In the Azure portal, open your Consumption logic app with blank workflow in the designer.
-
In the designer, follow these general steps to add the SFTP-SSH trigger that you want.
-
If prompted, provide the necessary connection information. When you're done, select Create.
-
After the trigger information box appears, provide the necessary details for your selected trigger. For more information, see SFTP-SSH managed connector triggers reference.
-
When you're done, save your workflow. On the designer toolbar, select Save.
-
In the Azure portal, open your Standard logic app with blank workflow in the designer.
-
In the designer, follow these general steps to add the SFTP-SSH built-in trigger that you want.
-
If prompted, provide the necessary connection information. When you're done, select Create.
-
After the trigger information box appears, provide the necessary details for your selected trigger. For more information, see SFTP built-in connector triggers reference.
-
When you're done, save your workflow. On the designer toolbar, select Save.
-
In the Azure portal, open your Standard logic app with blank workflow in the designer.
-
In the designer, follow these general steps to add the SFTP-SSH managed trigger that you want.
-
If prompted, provide the necessary connection information. When you're done, select Create.
-
After the trigger information box appears, provide the necessary details for your selected trigger. For more information, see SFTP-SSH managed connector triggers reference.
-
When you're done, save your workflow. On the designer toolbar, select Save.
When you save your workflow, this step automatically publishes your updates to your deployed logic app, which is live in Azure. With only a trigger, your workflow just checks the FTP server based on your specified schedule. You have to add an action that responds to the trigger and does something with the trigger outputs.
For example, the trigger named When a file is added or modified starts a workflow when a file is added or changed on an SFTP server. As a subsequent action, you can add a condition that checks whether the file content meets your specified criteria. If the content meets the condition, use the action named Get file content to get the file content, and then use another action to put that file content into a different folder on the SFTP server.
Before you can use an SFTP action, your workflow must already start with a trigger, which can be any kind that you choose. For example, you can use the generic Recurrence built-in trigger to start your workflow on specific schedule.
-
In the Azure portal, open your Consumption logic app with workflow in the designer.
-
In the designer, follow these general steps to add the SFTP-SSH action that you want.
-
If prompted, provide the necessary connection information. When you're done, select Create.
-
After the action information box appears, provide the necessary details for your selected action. For more information, see SFTP-SSH managed connector actions reference.
-
When you're done, save your workflow. On the designer toolbar, select Save.
-
In the Azure portal, open your Standard logic app with workflow in the designer.
-
In the designer, follow these general steps to add the SFTP-SSH built-in action that you want.
-
If prompted, provide the necessary connection information. When you're done, select Create.
-
After the action information box appears, provide the necessary details for your selected action. For more information, see SFTP built-in connector actions reference.
-
When you're done, save your workflow. On the designer toolbar, select Save.
-
In the Azure portal, open your Standard logic app with workflow in the designer.
-
In the designer, follow these general steps to add the SFTP-SSH managed action that you want.
-
If prompted, provide the necessary connection information. When you're done, select Create.
-
After the action information box appears, provide the necessary details for your selected action. For more information, see SFTP-SSH managed connector actions reference.
-
When you're done, save your workflow. On the designer toolbar, select Save.
For example, the action named Get file content using path gets the content from a file on an SFTP server by specifying the file path. You can use the trigger from the previous example and a condition that the file content must meet. If the condition is true, a subsequent action can get the content.
For more information, see the following documentation: