Connect to FTP servers - Azure Logic Apps (2024)

  • Article

Applies to: Azure Logic Apps (Consumption + Standard)

This article shows how to access your File Transfer Protocol (FTP) server from a workflow in Azure Logic Apps with the FTP connector. You can then create automated workflows that run when triggered by events in your FTP server or in other systems and run actions to manage files on your FTP server.

For example, your workflow can start with an FTP trigger that monitors and responds to events on your FTP server. The trigger makes the outputs available to subsequent actions in your workflow. Your workflow can run FTP actions that create, send, receive, and manage files through your FTP server account using the following specific tasks:

  • Monitor when files are added or changed.
  • Create, copy, delete, list, and update files.
  • Get file metadata and content.
  • Manage folders.

If you're new to Azure Logic Apps, review the following get started documentation:

  • What is Azure Logic Apps
  • Quickstart: Create an example Consumption logic app workflow

Connector technical reference

The FTP connector has different versions, based on logic app type and host environment.

Logic app type (plan)EnvironmentConnector version
ConsumptionMulti-tenant Azure Logic AppsManaged connector (Standard class). For more information, review the following documentation:

- FTP managed connector reference
- Managed connectors in Azure Logic Apps

ConsumptionIntegration service environment (ISE)Managed connector (Standard class) and ISE version, which has different message limits than the Standard class. For more information, review the following documentation:

- FTP managed connector reference
- ISE message limits
- Managed connectors in Azure Logic Apps

StandardSingle-tenant Azure Logic Apps and App Service Environment v3 (Windows plans only)Managed connector (Azure-hosted) and built-in connector, which is service provider based. The built-in connector can directly access Azure virtual networks with a connection string. For more information, review the following documentation:

- FTP managed connector reference
- FTP built-in connector operations section later in this article
- Managed connectors in Azure Logic Apps
- Built-in connectors in Azure Logic Apps

Limitations

  • Capacity and throughput

    • Built-in connector for Standard workflows:

      By default, FTP actions can read or write files that are 200 MB or smaller. Currently, the FTP built-in connector doesn't support chunking.

    • Managed or Azure-hosted connector for Consumption and Standard workflows

      By default, FTP actions can read or write files that are 50 MB or smaller. To handle files larger than 50 MB, FTP actions support message chunking. The Get file content action implicitly uses chunking.

  • Triggers for the FTP managed or Azure-hosted connector might experience missing, incomplete, or delayed results when the "last modified" timestamp is preserved. On the other hand, the FTP built-in connector trigger in Standard logic app workflows doesn't have this limitation. For more information, review the FTP connector's Limitations section.

  • The FTP managed or Azure-hosted connector can create a limited number of connections to the FTP server, based on the connection capacity in the Azure region where your logic app resource exists. If this limit poses a problem in a Consumption logic app workflow, consider creating a Standard logic app workflow and use the FTP built-in connector instead.

Prerequisites

  • An Azure account and subscription. If you don't have an Azure subscription, sign up for a free Azure account.

  • The logic app workflow where you want to access your FTP account. To start your workflow with an FTP trigger, you have to start with a blank workflow. To use an FTP action, start your workflow with another trigger, such as the Recurrence trigger.

  • For more requirements that apply to both the FTP managed connector and built-in connector, review the FTP managed connector reference - Requirements.

Known issues

By default, triggers that return an array have a Split On setting that's already enabled. With this setting enabled, the trigger automatically debatches the 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.

However, when the Split On setting is enabled, managed connector triggers return the outputs for all the array items as lists. Any subsequent actions that reference these outputs have to 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 have to apply this approach only for managed connector triggers, not built-in connector triggers that return outputs for one array item at a time when the Split On setting is 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:

  1. Get file metadata to get each file's metadata.

  2. Get file content action to get each file's content.

Add an FTP trigger

A Consumption logic app workflow can use only the FTP managed connector. However, a Standard logic app workflow can use the FTP managed connector and the FTP built-in connector. In a Standard logic app workflow, managed connectors are also labeled as Azure connectors.

The FTP managed connector and built-in connector each have only one trigger available:

  • Managed connector trigger: The FTP trigger named When a file is added or modified (properties only) runs a Consumption or Standard logic app workflow when one or more files are added or changed in a folder on the FTP server. This trigger gets only the file properties or metadata, not the file content. However, to get the file content, your workflow can follow this trigger with other FTP actions.

    For more information about this trigger, review When a file is added or modified (properties only).

  • Built-in connector trigger: The FTP trigger named When a file is added or updated runs a Standard logic app workflow when one or more files are added or changed in a folder on the FTP server. This trigger gets only the file properties or metadata, not the file content. However, to get the content, your workflow can follow this trigger with other FTP actions. For more information about this trigger, review When a file is added or updated.

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

  • Consumption
  • Standard
  1. In the Azure portal, and open your blank logic app workflow in the designer.

  2. On the designer, under the search box, select Standard. In the search box, enter ftp.

  3. From the triggers list, select the trigger named When a filed is added or modified (properties only).

    Connect to FTP servers - Azure Logic Apps (1)

  4. Provide the information for your connection. When you're done, select Create.

    Note

    By default, this connector transfers files in text format. To transfer files in binary format,for example, where and when encoding is used, select the binary transport option.

    Connect to FTP servers - Azure Logic Apps (2)

  5. After the trigger information box appears, find the folder that you want to monitor for new or edited files.

    1. In the Folder box, select the folder icon to view the folder directory.

    2. Select the right angle arrow (>). Browse to the folder that you want, and then select the folder.

    Connect to FTP servers - Azure Logic Apps (3)

    Your selected folder appears in the Folder box.

    Connect to FTP servers - Azure Logic Apps (4)

  6. When you're done, save your workflow.

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.

Add an FTP action

A Consumption logic app workflow can use only the FTP managed connector. However, a Standard logic app workflow can use the FTP managed connector and the FTP built-in connector. Each version has multiple actions. For example, both managed and built-in connector versions have their own actions to get file metadata and get file content.

  • Managed connector actions: These actions run in a Consumption or Standard logic app workflow.

  • Built-in connector actions: These actions run only in a Standard logic app workflow.

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

Before you can use an FTP 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.

  • Consumption
  • Standard
  1. In the Azure portal, and open your logic app workflow in the designer.

  2. Find and select the FTP action that you want to use.

    This example continues with the action named Get file metadata so you can get the metadata for a single array item.

    1. On the designer, under the trigger or any other actions, select New step.

    2. Under the Choose an operation search box, select Standard.

    3. In the search box, enter ftp get file metadata.

    4. From the actions list, select the action named Get file metadata.

    Connect to FTP servers - Azure Logic Apps (5)

  3. If necessary, provide the information for your connection. When you're done, select Create.

    Note

    By default, this connector transfers files in text format. To transfer files in binary format,for example, where and when encoding is used, select the binary transport option.

    Connect to FTP servers - Azure Logic Apps (6)

  4. After the Get file metadata action information box appears, click inside the File box so that the dynamic content list opens.

    You can now select outputs from the preceding trigger.

  5. In the dynamic content list, under When a file is added or modified, select List of Files Id.

    Connect to FTP servers - Azure Logic Apps (7)

    The File property now references the List of Files Id trigger output.

  6. On the designer, under the Get file metadata action, select New step.

  7. Under the Choose an operation search box, select Standard.

  8. In the search box, enter ftp get file content.

  9. From the actions list, select the action named Get file content.

    Connect to FTP servers - Azure Logic Apps (8)

  10. After the Get file content action information box appears, click inside the File box so that the dynamic content list opens.

    You can now select outputs from the preceding trigger and any other actions.

  11. In the dynamic content list, under Get file metadata, select Id, which references the file that was added or updated.

    Connect to FTP servers - Azure Logic Apps (9)

    The File property now references the Id action output.

    Connect to FTP servers - Azure Logic Apps (10)

  12. When you're done, save your workflow. On the designer toolbar, select Save.

Test your workflow

To check that your workflow returns the content that you expect, add another action that sends you the content from the added or updated file. This example uses the Office 365 Outlook action named Send an email.

  • Consumption
  • Standard
  1. Under the Get file content action, add the Office 365 Outlook action named Send an email. If you have an Outlook.com account instead, add the Outlook.com Send an email action, and adjust the following steps accordingly.

    1. On the designer, under the Get file content action, select New step.

    2. Under the Choose an operation search box, select Standard.

    3. In the search box, enter office 365 outlook send an email. From the actions list, select the Office 365 Outlook action named Send an email.

    Connect to FTP servers - Azure Logic Apps (11)

  2. If necessary, sign in to your email account.

  3. In the action information box, provide the required values and include any other parameters or properties that you want to test.

    For example, you can include the File content output from the Get file content action. To find this output, follow these steps:

    1. In the Get file content action, click inside the Body box so that the dynamic content list opens.

    2. In the dynamic content list, next to Get file content, select See more.

      Connect to FTP servers - Azure Logic Apps (12)

    3. In the dynamic content list, under Get file content, select File Content.

      The Body property now references the File Content action output.

      Connect to FTP servers - Azure Logic Apps (13)

  4. Save your logic app workflow.

  5. To run and trigger the workflow, on the designer toolbar, select Run Trigger > Run. Add a file to the FTP folder that your workflow monitors.

FTP built-in connector operations

The FTP built-in connector is available only for Standard logic app workflows and provides the following operations:

TriggerDescription
When a file is added or updatedStart a logic app workflow when a file is added or updated in the specified folder on the FTP server.

Note: This trigger gets only the file metadata or properties, not the file content. However, to get the content, your workflow can follow this trigger with the Get file content action.

ActionDescription
Create fileCreate a file using the specified file path and file content.
Delete fileDelete a file using the specified file path.
Get file contentGet the content of a file using the specified file path.
Get file metadataGet the metadata or properties of a file using the specified file path.
List files and subfolders in a folderGet a list of files and subfolders in the specified folder.
Update fileUpdate a file using the specified file path and file content.

When a file is added or updated

Operation ID: whenFtpFilesAreAddedOrModified

This trigger starts a logic app workflow run when a file is added or updated in the specified folder on the FTP server. The trigger gets only the file metadata or properties, not any file content. However, to get the content, your workflow can follow this trigger with the Get file content action.

Parameters

NameKeyRequiredTypeDescription
Folder pathfolderPathTruestringThe folder path, relative to the root directory.
Number of files to returnmaxFileCountFalseintegerThe maximum number of files to return from a single trigger run. Valid values range from 1 - 100.

Note: By default, the Split On setting is enabled and forces this trigger to process each file individually in parallel.

Cutoff timestamp to ignore older filesoldFileCutOffTimestampFalsedateTimeThe cutoff time to use for ignoring older files. Use the timestamp format YYYY-MM-DDTHH:MM:SS. To disable this feature, leave this property empty.

Returns

When the trigger's Split On setting is enabled, the trigger returns the metadata or properties for one file at a time. Otherwise, the trigger returns an array that contains each file's metadata.

NameType
List of filesBlobMetadata

Create file

Operation ID: createFile

This action creates a file using the specified file path and file content. If the file already exists, this action overwrites that file.

Important

If you delete or rename a file on the FTP server immediately after creation within the same workflow,the operation might return an HTTP 404 error, which is by design. To avoid this problem, includea 1-minute delay before you delete or rename any newly created files. You can use theDelay action to add this delay to your workflow.

Parameters

NameKeyRequiredTypeDescription
File pathfilePathTruestringThe file path, including the file name extension if any, relative to the root directory.
File contentfileContentTruestringThe file content.

Returns

This action returns a BlobMetadata object named Body.

NameType
File metadata File namestring
File metadata File pathstring
File metadata File sizestring
File metadataBlobMetadata

Delete file

Operation ID: deleteFtpFile

This action deletes a file using the specified file path.

Parameters

NameKeyRequiredTypeDescription
File pathfilePathTruestringThe file path, including the file name extension if any, relative to the root directory.

Returns

None

Get file content

Operation ID: getFtpFileContent

This action gets the content of a file using the specified file path.

Parameters

NameKeyRequiredTypeDescription
File pathpathTruestringThe file path, including the file name extension if any, relative to the root directory.

Returns

This action returns the content of a file as a binary value named File content.

NameType
File contentBinary

Get file metadata

Operation ID: getFileMetadata

This action gets the metadata or properties of a file using the specified file path.

Parameters

NameKeyRequiredTypeDescription
File pathpathTruestringThe file path, including the file name extension if any, relative to the root directory.

Returns

This action returns the following outputs:

NameType
File namestring
File pathstring
File sizestring
Last updated timestring
File metadataBlobMetadata

List files and subfolders in a folder

Operation ID: listFilesInFolder

This action gets a list of files and subfolders in the specified folder.

Parameters

NameKeyRequiredTypeDescription
Folder pathfolderPathTruestringThe folder path, relative to the root directory.
File contentfileContentTruestringThe content for the file

Returns

This action returns an array that's named Response and contains BlobMetadata objects.

NameType
ResponseArray with BlobMetadata objects

Update file

Operation ID: updateFile

This action updates a file using the specified file path and file content.

Important

If you delete or rename a file on the FTP server immediately after creation within the same workflow,the operation might return an HTTP 404 error, which is by design. To avoid this problem, includea 1-minute delay before you delete or rename any newly created files. You can use theDelay action to add this delay to your workflow.

Parameters

NameKeyRequiredTypeDescription
File pathfilePathTruestringThe file path, including the file name extension if any, relative to the root directory.
File contentfileContentTruestringThe content for the file

Returns

This action returns a BlobMetadata object named Body.

NameType
BodyBlobMetadata

Next steps

  • Managed connectors for Azure Logic Apps
  • Built-in connectors for Azure Logic Apps
  • What are connectors in Azure Logic Apps
Connect to FTP servers - Azure Logic Apps (2024)
Top Articles
Latest Posts
Article information

Author: Kimberely Baumbach CPA

Last Updated:

Views: 5761

Rating: 4 / 5 (61 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Kimberely Baumbach CPA

Birthday: 1996-01-14

Address: 8381 Boyce Course, Imeldachester, ND 74681

Phone: +3571286597580

Job: Product Banking Analyst

Hobby: Cosplaying, Inline skating, Amateur radio, Baton twirling, Mountaineering, Flying, Archery

Introduction: My name is Kimberely Baumbach CPA, I am a gorgeous, bright, charming, encouraging, zealous, lively, good person who loves writing and wants to share my knowledge and understanding with you.