Partilhar via


FTP

The File Transfer Protocol (FTP) is a standard network protocol used to transfer computer files between a client and server on a computer network. FTP is built on a client-server model architecture and uses separate control and data connections between the client and the server.

This connector is available in the following products and regions:

Service Class Regions
Logic Apps Standard All Logic Apps regions and Integration Service Environments (ISEs)
Power Automate Standard All Power Automate regions except the following:
     -   US Government (GCC High)
     -   US Department of Defense (DoD)
Power Apps Standard All Power Apps regions except the following:
     -   US Government (GCC High)
     -   US Department of Defense (DoD)
Connector Metadata
Publisher Microsoft

Known issues and limitations

  • This article describes the operations only for the FTP managed connector, which is available for Azure Logic Apps, Power Automate, and Power Apps. The FTP built-in connector is available only for Standard logic app workflows in Azure Logic Apps. For more information about the FTP built-in connector in Azure Logic Apps, review Connect to FTP servers from workflows in Azure Logic Apps.

  • FTP triggers now return only metadata or properties, not file content. However, you can follow these triggers with the action named Get file content. To make sure that a trigger returns one file at a time, rather than a list, make sure to enable the trigger's "Split On" option. For more information about this option in Azure Logic Apps, review Trigger multiple runs.

  • FTP triggers work only on the specified folder, not subfolders. To also check a folder's subfolders, set up a separate flow for each subfolder.

  • By default, FTP managed connector actions can read or write files that are 50 MB or smaller. To handle files larger than 50 MB, you can use the use the FTP managed connector action named Get file content, which implicitly uses message chunking. Other FTP managed connector actions also support enabling message chunking.

  • FTP triggers might experience delays or incomplete results when returning newly created, added, or updated files.

    When an FTP trigger checks for a newly added or changed file, the trigger also confirms that the file is complete. For example, a file might have changes in progress when the trigger checks the FTP server. To avoid returning an incomplete file, the trigger notes the file's timestamp, but doesn't immediately return the file. Instead, the trigger returns the file only when the trigger checks the server again. Sometimes, this behavior might cause a delay that lasts up to twice the trigger's polling interval. Due to this behavior, the FTP trigger might not return all files at the same time if you disable the FTP trigger's Split On setting,

  • FTP managed connector triggers might experience missing, incomplete, or delayed results when the "last modified" timestamp is preserved.

    • Missing results

      FTP triggers work by polling, or checking, the FTP file system and looking for any files that changed since the last poll. The FTP managed connector triggers compare file versions using the file's last modified timestamp.

      If you create, add, or update file with a timestamp that's earlier than the currently tracked last modified timestamp, the FTP managed connector trigger won't detect this file. On the other hand, the FTP built-in connector trigger in Standard logic app workflows doesn't have this limitation.

      So, if you use an external tool or client that creates, adds, or updates files on the FTP server, make sure that you disable any feature in the tool or client that preserves a file's last modified timestamp.

      The following table lists some commonly used tools that preserve this timestamp and the steps to disable this feature:

      FTP client Action
      WinSCP Go to Options > Preferences > Transfer > Edit > Preserve timestamp > Disable.
      FileZilla Go to Transfer > Preserve timestamps of transferred files > Disable.
    • Incomplete or delayed results

      When an FTP trigger checks for a newly created, added, or updated file, the trigger also checks whether the file is complete. For example, a file might have changes in progress when the trigger checks the FTP server. To avoid returning an incomplete file, the trigger notes the file's timestamp, but doesn't immediately return the file. Instead, the trigger returns the file only when the trigger checks the server again.

      Sometimes, this behavior might cause a delay that lasts as long as almost twice the trigger's polling interval. Due to this behavior, if you disable the FTP trigger's Split On setting, the FTP trigger might not return all files at the same time.

Requirements

  • The FTP connector requires your FTP host server address and account credentials.

  • The FTP connector requires access to the FTP server from or through the internet. For more information about allowing traffic to your FTP server using specific IP ranges, review Managed connector IP addresses.

  • The FTP connector requires the FTP server to operate or accept in passive mode.

  • The FTP connector requires the FTP server to enable the following commands and to support folders that contain whitespace so the commands can work correctly. For the LIST command, make sure the command returns the year component for file timestamps older than 6 months.

    • APPE
    • DELE
    • LIST
    • MDTM
    • RENAME
    • RETR
    • SIZE
    • STOR
  • For secure FTP, make sure to set up explicit File Transfer Protocol Secure (FTPS), rather than implicit FTPS. Also, some FTP servers, such as ProFTPd, require that you enable the NoSessionReuseRequired option if you use Transport Layer Security (TLS) mode, the successor to Secure Socket Layer (SSL).

    The FTP connector doesn't work with implicit FTPS and supports only explicit FTP over FTPS, which is an extension of TLS.

FTP connections

  • To improve performance for both the FTP connector and FTP server, you can keep your FTP connection open and active after the connector completes a request.

    When you create a connection to an FTP server, the connection profile box that appears has a setting named Close connection after request completion. This setting specifies whether to close the FTP server connection every time after an request completes. If you keep this setting disabled, the connection won't close after a request completes and stays active for future use.

  • If your workflow instances run in parallel, you might experience intermittent connectivity errors. Some operations in your workflow might forcibly close the connection even while other operations in the workflow are still using that connection.

    To avoid this scenario, try the following recommendations:

    • When you create the connection, enable the Close connection after request completion setting.

    • Turn off any parallelization or concurrency that's enabled on triggers or actions. For more information about this solution in Azure Logic Apps, review the following documentation:

    • Avoid running multiple parallel flows.

Use the "Create file" action with and without chunking

For the Create file action, the behavior depends on the action's Allow chunking setting and the size of the file to create:

  • Allow chunking enabled:

    • File size is equal or less than 50 MB: The action uploads the file with a single request, uses the original file name, and locks the file during the upload.

    • File size is greater than 50 MB: The action creates the file with the name format, file-name.new-GUID.ms.partial, and uploads the file using multiple requests, or message chunking. After the action uploads the last chunk, the action renames the file with the original file name.

  • Allow chunking disabled: The action uploads the file with a single request, uses the original file name, and locks the file during the upload.

Connector how-to guide

For information about how to use the FTP managed connector and built-in connector in Azure Logic Apps, review Connect to FTP servers from workflows in Azure Logic Apps.

General Limits

Name Value
Maximum number of folders in a single archive. This limit only applies when 'Create folders?' is set to 'Yes'. 16
Maximum number of megabytes being transferred to/from the connector within a bandwidth time interval (per connection) 1000
Bandwidth time interval (in miliseconds) 60000

Creating a connection

The connector supports the following authentication types:

Default Parameters for creating connection. All regions Not shareable

Default

Applicable: All regions

Parameters for creating connection.

This is not shareable connection. If the power app is shared with another user, another user will be prompted to create new connection explicitly.

Name Type Description Required
Server Address string Server Address True
User Name string User Name True
Password securestring Password True
FTP Server Port int FTP Port Number (example: 21)
Enable SSL? bool Enable SSL? (True/False)
Binary Transport? bool Enable Binary Transport? (True/False)
Disable Certificate Validation? bool Disable Certificate Validation? (True/False)
Close connection after request completion bool Close FTP connection everytime after request completes? (True/False)

Throttling Limits

Name Calls Renewal Period
API calls per connection 900 60 seconds

Actions

Copy file

This operation copies a file to an FTP server. If a file is being deleted/renamed on server right after it was copied, connector may return HTTP 404 error by it's design. Please use a delay for 1 minute before deleting or renaming newly created file.

Create file

This operation creates a file. If a file is being deleted/renamed on server right after it was created, connector may return HTTP 404 error by it's design. Please use a delay for 1 minute before deleting or renaming newly created file.

Delete file

This operation deletes a file.

Extract archive to folder

This operation extracts an archive file into a folder (example: .zip).

Get file content

This operation gets the content of a file.

Get file content using path

This operation gets the content of a file using the file path.

Get file metadata

This operation gets the metadata for a file.

Get file metadata using path

This operation gets the metadata of a file using the file path.

List files in folder

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

List files in root folder

This operation gets the list of files and subfolders in the root folder.

Update file

This operation updates a file. If a file is being deleted/renamed on server right after it was updated, connector may return HTTP 404 error by it's design. Please use a delay for 1 minute before deleting or renaming recently updated file.

Copy file

This operation copies a file to an FTP server. If a file is being deleted/renamed on server right after it was copied, connector may return HTTP 404 error by it's design. Please use a delay for 1 minute before deleting or renaming newly created file.

Parameters

Name Key Required Type Description
Source url
source True string

Url to source file

Destination file path
destination True string

Destination file path, including target filename

Overwrite?
overwrite boolean

Overwrites the destination file if set to 'true'

Returns

Blob metadata

Create file

This operation creates a file. If a file is being deleted/renamed on server right after it was created, connector may return HTTP 404 error by it's design. Please use a delay for 1 minute before deleting or renaming newly created file.

Parameters

Name Key Required Type Description
Folder path
folderPath True string

Select a folder

File name
name True string

Name of the file

File content
body True binary

Content of the file

Get all file metadata
ReadFileMetadataFromServer boolean

Get all file metadata from the SFTP server after file creation is complete. If this is false, some metadata properties may not be returned such as last modified time, etc.

Returns

Blob metadata

Delete file

This operation deletes a file.

Parameters

Name Key Required Type Description
File
id True string

Select a file

Extract archive to folder

This operation extracts an archive file into a folder (example: .zip).

Parameters

Name Key Required Type Description
Source archive file path
source True string

Path to the archive file

Destination folder path
destination True string

Path to the destination folder

Overwrite?
overwrite boolean

Overwrites the destination files if set to 'true'

Create folders?
createFolders boolean

Extracts folders from archive if set to 'true'

Returns

Get file content

This operation gets the content of a file.

Parameters

Name Key Required Type Description
File
id True string

Select a file

Infer Content Type
inferContentType boolean

Infer content-type based on extension

Returns

The content of the file.

File Content
binary

Get file content using path

This operation gets the content of a file using the file path.

Parameters

Name Key Required Type Description
File path
path True string

Select a file

Infer Content Type
inferContentType boolean

Infer content-type based on extension

Returns

The content of the file.

File Content
binary

Get file metadata

This operation gets the metadata for a file.

Parameters

Name Key Required Type Description
File
id True string

Select a file

Returns

Blob metadata

Get file metadata using path

This operation gets the metadata of a file using the file path.

Parameters

Name Key Required Type Description
File path
path True string

Select a file

Returns

Blob metadata

List files in folder

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

Parameters

Name Key Required Type Description
Folder
id True string

Select a folder

Returns

List files in root folder

This operation gets the list of files and subfolders in the root folder.

Returns

Update file

This operation updates a file. If a file is being deleted/renamed on server right after it was updated, connector may return HTTP 404 error by it's design. Please use a delay for 1 minute before deleting or renaming recently updated file.

Parameters

Name Key Required Type Description
File
id True string

Select a file

File content
body True binary

Content of the file

Returns

Blob metadata

Triggers

When a file is added or modified (properties only)

This operation triggers a flow when one or more files are added or modified in a folder. This trigger will only fetch the file metadata. To get the file content, you can use the "Get file content" operation. The trigger relies on the last modified time of a file. If a file is being created by a third-party client, the preservation of the last modified time should be disabled in the client. The trigger does not fire if a file is added/updated in a subfolder. If it is required to trigger on subfolders, multiple triggers should be created.

When a file is added or modified [DEPRECATED]

This operation triggers a flow when a file is added or modified in a folder. The trigger will fetch both the file metadata as well as the content of the file. The trigger relies on the last modified time of a file. If a file is being created by a third-party client, the preservation of the last modified time should be disabled in the client. Files larger than 50 megabytes are skipped by the trigger. The trigger does not fire if a file is added/updated in a subfolder. If it is required to trigger on subfolders, multiple triggers should be created.

When a file is added or modified (properties only)

This operation triggers a flow when one or more files are added or modified in a folder. This trigger will only fetch the file metadata. To get the file content, you can use the "Get file content" operation. The trigger relies on the last modified time of a file. If a file is being created by a third-party client, the preservation of the last modified time should be disabled in the client. The trigger does not fire if a file is added/updated in a subfolder. If it is required to trigger on subfolders, multiple triggers should be created.

Parameters

Name Key Required Type Description
Folder
folderId True string

Select a folder

Number of files to return
maxFileCount integer

Maximum number of files to return by single trigger run (1-100). Note that 'Split On' setting can force trigger to process each item individually.

Returns

Blob metadata

List of Files
BlobMetadata

When a file is added or modified [DEPRECATED]

This operation triggers a flow when a file is added or modified in a folder. The trigger will fetch both the file metadata as well as the content of the file. The trigger relies on the last modified time of a file. If a file is being created by a third-party client, the preservation of the last modified time should be disabled in the client. Files larger than 50 megabytes are skipped by the trigger. The trigger does not fire if a file is added/updated in a subfolder. If it is required to trigger on subfolders, multiple triggers should be created.

Parameters

Name Key Required Type Description
Folder
folderId True string

Select a folder

Include file content
includeFileContent boolean

If set to true, file content will also be retrieved along with the trigger response

Infer Content Type
inferContentType boolean

Infer content-type based on extension

Returns

The content of the file.

File Content
binary

Definitions

BlobMetadata

Blob metadata

Name Path Type Description
Id
Id string

The unique id of the file or folder.

Name
Name string

The name of the file or folder.

DisplayName
DisplayName string

The display name of the file or folder.

Path
Path string

The path of the file or folder.

LastModified
LastModified date-time

The date and time the file or folder was last modified.

Size
Size integer

The size of the file or folder.

MediaType
MediaType string

The media type of the file or folder.

IsFolder
IsFolder boolean

A boolean value (true, false) to indicate whether or not the blob is a folder.

ETag
ETag string

The etag of the file or folder.

FileLocator
FileLocator string

The filelocator of the file or folder.

binary

This is the basic data type 'binary'.