SFTP (SSH File Transfer Protocol) is a network protocol that provides file access, file transfer, and file management over any reliable data stream. It was designed by the Internet Engineering Task Force (IETF) as an extension of the Secure Shell protocol (SSH) version 2.0 to provide secure file transfer capabilities.
I originally posted this question and answer on StackOverflow but was told it was off-topic. I also updated it to avoid nc’s change in handling of superfluous command line arguments. SFTP happens to be used by SSH servers but it's a well-develop. WinSCP Download For Windows. Winscp is free SSH, SFTP, FTP Client. Winscp is secure shell software to access remote servers. Download WinSCP Latest Version.
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) |
Power Apps | Standard | All Power Apps regions except the following: - US Government (GCC High) |
Contact | |
---|---|
Name | Microsoft |
URL | Microsoft LogicApps Support Microsoft Power Automate Support Microsoft Power Apps Support |
Connector Metadata | |
---|---|
Publisher | Microsoft |
This connector is on its deprecation path, please use the new SFTP-SSH connector. Please read more how to use the new connector here.
To use this connector, you will need access to an SSH private key and the SSH private key passphrase.
The following private key formats are supported:
OpenSSH
ssh.com
PuTTY
The content of the SSH private key should be copied/pasted entirely into the “SSH private key” field in the multiline format. Below are sample steps how to provide the SSH private key using Notepad.exe:
- Open the SSH private key file in Notepad.exe;
- Click Edit → Select All;
- Click Edit → Copy;
- In the 'SSH private key' field (while creating a connection) click right mouse button and click Paste. Do not edit the 'SSH private key' field manually.
Trigger limits
The triggers work by polling the SFTP file system, and looking for any file which has been modified since the last poll, comparing files by modification time. Certain tools allow the file modification time to be preserved. In such cases, you need to disable the feature for your trigger to work. Here are some common settings:
SFTP client | Action |
---|---|
WinSCP | Options → Preferences… → Transfer → Edit… → Preserve timestamp → Disable |
FileZilla | Transfer → Preserve timestamps of transferred files → Disable |
When the triggers encounter a new file, it will try to ensure that the new file is completely written. For instance, it is possible that the file is being written or modified, and updates are being made at the time the trigger polled the file server. To avoid returning a file with partial content, the trigger will take note of the timestamp such files which are modified recently, but will not immediately return those files. Those files will be returned only when the trigger polls again. Sometimes, this may lead a delay up to twice the trigger polling interval. This also means that the trigger does not guarantee to return all files in a single run when 'Split On' option is disabled.
The trigger doesn't pick up files over 50MB if the content is asked for.
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.
Connector in-depth
For more information about the connector, see the in-dept section.
Creating a connection
The connector supports the following authentication types:
Default | Required parameters for creating connection. | All regions | Not shareable |
Default
Applicable: All regions
Required 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 |
---|---|---|
Host Server Address | string | Host Server Address |
User Name | string | User Name |
Password | securestring | Password |
SSH private key | securestring | SSH private key (the content of the file should be provided entirely as is, in the multiline format) |
SSH private key passphrase | securestring | SSH private key passphrase (if the private key is protected by a passphrase) |
Port Number | int | SFTP Port Number (example: 22) |
Disable SSH Host Key Validation | bool | Disable SSH Host Key Validation? (True/False) |
SSH Host Key Finger-print | string | SSH Host Key Finger-print |
Disable Resume Capability | bool | Disable Resume Capability? (True/False) |
Throttling Limits
Name | Calls | Renewal Period |
---|---|---|
API calls per connection | 100 | 60 seconds |
Actions
Copy file [DEPRECATED] | This action has been deprecated. Please use Copy file instead.
|
Create file [DEPRECATED] | This action has been deprecated. Please use Create file instead.
|
Delete file [DEPRECATED] | This action has been deprecated. Please use Delete file instead.
|
Extract archive to folder [DEPRECATED] | This action has been deprecated. Please use Extract archive to folder instead.
|
Get file content [DEPRECATED] | This action has been deprecated. Please use Get file content instead.
|
Get file content using path [DEPRECATED] | This action has been deprecated. Please use Get file content using path instead.
|
Get file metadata [DEPRECATED] | This action has been deprecated. Please use Get file metadata instead.
|
Get file metadata using path [DEPRECATED] | This action has been deprecated. Please use Get file metadata using path instead.
|
List files in folder [DEPRECATED] | This action has been deprecated. Please use List files in folder instead.
|
List files in root folder [DEPRECATED] | This action has been deprecated. Please use List files in root folder instead.
|
Update file [DEPRECATED] | This action has been deprecated. Please use Update file instead.
|
Copy file [DEPRECATED]
This action has been deprecated. Please use Copy file instead.
This operation copies a file to an SFTP 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 | True | string | Path to the source file | |
Destination file path | destination | True | string | Path to the destination file, including file name |
overwrite | boolean | Overwrites the destination file if set to 'true' |
Returns
Blob metadata
- Body
- BlobMetadata
Create file [DEPRECATED]
This action has been deprecated. Please use Create file instead.
This operation uploads a file to an SFTP server. 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 |
---|---|---|---|---|
folderPath | True | string | Unique path of the folder | |
File name | name | True | string | Name of the file |
body | True | binary | Content of the file to create |
Returns
Blob metadata
- Body
- BlobMetadata
Delete file [DEPRECATED]
This action has been deprecated. Please use Delete file instead.
This operation deletes a file.
Parameters
Name | Key | Required | Type | Description |
---|---|---|---|---|
id | True | string | Specify the file |
Extract archive to folder [DEPRECATED]
This action has been deprecated. Please use Extract archive to folder instead.
This operation extracts an archive file into a folder (example: .zip).
Parameters
Name | Key | Required | Type | Description |
---|---|---|---|---|
source | True | string | Path to the archive file | |
Destination folder path | destination | True | string | Path to the destination folder |
overwrite | boolean | Overwrites the destination files if set to 'true' |
Returns
- response
- array of BlobMetadata
Get file content [DEPRECATED]
This action has been deprecated. Please use Get file content instead.
This operation gets file contents using the file id.
Parameters
Name | Key | Required | Type | Description |
---|---|---|---|---|
id | True | string | Specify the file | |
Infer Content Type | inferContentType | boolean | Infer content-type based on extension |
Returns
The content of the file.
Get file content using path [DEPRECATED]
This action has been deprecated. Please use Get file content using path instead.
This operation gets file contents using the file path.
Parameters
Name | Key | Required | Type | Description |
---|---|---|---|---|
path | True | string | Unique path of the file | |
Infer Content Type | inferContentType | boolean | Infer content-type based on extension |
Returns
The content of the file.
Get file metadata [DEPRECATED]
This action has been deprecated. Please use Get file metadata instead.
This operation gets file metadata using the file id.
Parameters
Name | Key | Required | Type | Description |
---|---|---|---|---|
id | True | string | Specify the file |
Returns
Blob metadata
- Body
- BlobMetadata
Get file metadata using path [DEPRECATED]
This action has been deprecated. Please use Get file metadata using path instead.
This operation gets file metadata using the file path.
Parameters
Name | Key | Required | Type | Description |
---|---|---|---|---|
path | True | string | Unique path of the file |
Returns
Blob metadata
- Body
- BlobMetadata
List files in folder [DEPRECATED]
This action has been deprecated. Please use List files in folder instead.
This operation gets files contained in a folder.
Parameters
Name | Key | Required | Type | Description |
---|---|---|---|---|
id | True | string | Specify the folder |
Returns
- response
- array of BlobMetadata
List files in root folder [DEPRECATED]
This action has been deprecated. Please use List files in root folder instead.
This operation gets the files in the root folder.
Returns
Update file [DEPRECATED]
This action has been deprecated. Please use Update file instead.
This operation updates the file content. 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 |
---|---|---|---|---|
id | True | string | Specify the file | |
File content | body | True | binary | Content of the file to update |
Returns
Blob metadata
Triggers
When a file is added or modified (properties only) [DEPRECATED] | This action has been deprecated. Please use When files are added or modified (properties only) instead.
|
When a file is added or modified [DEPRECATED] | This action has been deprecated. Please use When a file is added or modified instead.
|
When a file is added or modified (properties only) [DEPRECATED]
This action has been deprecated. Please use When files are added or modified (properties only) instead.
This operation triggers a flow when a file is 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 |
---|---|---|---|---|
folderId | True | string | Select a folder | |
Number of files to return from the trigger | maxFileCount | integer | Max files count (1-100) |
Returns
Blob metadata
When a file is added or modified [DEPRECATED]
This action has been deprecated. Please use When a file is added or modified instead.
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
Sftp Without Ssh Key
Name | Key | Required | Type | Description |
---|---|---|---|---|
folderId | True | string | Specify a folder | |
Include file content | includeFileContent | boolean | If set to true, file content will also be retrieved along with the trigger response | |
inferContentType | boolean | Infer content-type based on extension |
Returns
The content of the file.
- File Content
- binary
Definitions
Sftp Vs Ssh
BlobMetadata
Ssh Sftp Client
Blob metadata
Sftp No Ssh Login
Name | Path | Type | Description |
---|---|---|---|
Id | string | The unique id of the file or folder. | |
Name | Name | string | The name of the file or folder. |
DisplayName | string | The display name of the file or folder. | |
Path | Path | string | The path of the file or folder. |
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 | 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 | string | The etag of the file or folder. | |
FileLocator | FileLocator | string | The filelocator of the file or folder. |