Inbound SFTP Stage
The Inbound SFTP stage allows messages to be ingested into the Integration Hub service by monitoring an external SFTP service for the creation of new files.
Stage Overview
The Inbound SFTP stage allows messages to be ingested into the Integration Hub service by monitoring an external SFTP service for the creation of new files.
Stage Definition File Location
All Inbound SFTP stages are defined by creating an appropriately formatted JSON definition file in the following location:
Stage JSON Definition File Format
The JSON definition file for an Inbound SFTP stage is as follows:
{
"name": "stage-name",
"displayName": "Brief Stage Title",
"description": "Brief description of the stage.",
"enabled": "$env:STATUS_<INTEGRATION_NAME>",
"concurrency": 10,
"recurrence": {
"interval": 10,
"frequency": "Minute"
},
"enableVnet": true,
"sftpDetails": {
"hostName": "$env:SFTP_HOSTNAME",
"userName": "$env:SFTP_USERNAME",
"password": "$env:SFTP_PASSWORD",
"port": "$env:SFTP_PORT",
"rootFolder": "$env:SFTP_ROOT_FOLDER",
"folderPath": "$env:SFTP_SUB_FOLDER",
"sshHostKeyFingerprint": "$env:SFTP_SSH_HOST_KEY_FINGERPRINT",
"sshPrivateKeySecretName": "$env:SFTP_SSH_PRIVATE_KEY",
"sshPrivateKeyPassphrase": "$env:SFTP_SSH_PRIVATE_KEY_PASSPHRASE",
"sshDisableConnectionCache": true
},
"actionRetryPolicy": {
"type": "fixed",
"interval": "PT5S",
"count": 90,
"minimumInterval": "PT5S",
"maximumInterval": "PT1H"
},
"filter": {
"fileName": "PO_",
"fileSize": 0,
"fileExtension": "xml"
},
"leaseLockName": "lock-name",
"deleteSourceFile": true,
"deduplicate": {
"timeWindow": "HH:MM:SS",
"schemaMessageId": "schemas/path/to/transform.liquid",
"fileType": "json|xml|csv",
"hasHeader": "true|false"
},
"lineEnding": "windows|unix",
"preLogTransformSchemaFileName": "schemas/path/to/schema/schema-name.liquid",
"preLogTransformSchemaType": "liquid|javascript",
"preLogTransformFormat": "json|xml|csv"
}
| Property | Sub-Property | Description |
|---|---|---|
name | The name of the stage. | |
displayName | Optional (but highly recommended). A short (3 or 4 word) "display name" for the stage, used as a "title" of the stage in the Integration Hub Portal service's self-documentation capability. | |
description | Optional (but highly recommended). A brief (10 to 15 word) description of the stage, used as a brief description of the stage's purpose in the Integration Hub Portal service's self-documentation capability. For a more detailed explanation (when needed), use the stage markdown feature. | |
enabled | Optional boolean flag (true or false). Default is true.Generally set via a DevOps variable. Controls if the stage is deployed enabled or not. | |
concurrency | Optional number of concurrent runs permitted for the stage. Default is 10. | |
recurrence | Object defining how often the external SFTP service should be checked to see if new files have been uploaded. | |
interval | The frequency check value. | |
frequency | The definition of the unit of frequency to check for incoming files. Supports Minutes. | |
enableVnet | Optional. Boolean flag to indicate if the SFTP connection should use VNet integration to ensure the use of a fixed IP address or not. Default value is false.VNet integration is only supported when deploying using Standard Logic Apps. | |
sftpDetails | ||
hostName | The hostname of the remote SFTP service to monitor for new payload messages. | |
userName | Use both userName and password together if authenticating to the remote SFTP server using a username and password. The userName is the username that will be used. | |
password | Use both userName and password together if authenticating to the remote SFTP server using a username and password. The password is the password that will be used. | |
port | The port of the remote SFTP service. Generally should be set to 22. | |
rootFolder | The root folder on the remote SFTP service. Generally /, but can be set to another directory to force the connector to change into this directory before using the folderPath. | |
folderPath | The directory under the rootFolder which will be checked for new files. | |
sshHostKeyFingerprint | Use the sshHostKeyFingerprint, sshPrivateKeySecretName and sshPrivateKeyPassphrase values together if authenticating via SSH key. | |
sshPrivateKeySecretName | Use the sshHostKeyFingerprint, sshPrivateKeySecretName and sshPrivateKeyPassphrase values together if authenticating via SSH key. Please see SSH Private Key Format on the specifics of using an SSH key with Azure.An $env: token for an Azure DevOps variable, or a $kv: token for a Key Vault secret, that holds the SSH private key. See Stage Secrets.The SSH private key needs to be Base64 encoded. | |
sshPrivateKeyPassphrase | Use the sshHostKeyFingerprint, sshPrivateKeySecretName and sshPrivateKeyPassphrase values together if authenticating via SSH key. | |
sshDisableConnectionCache | Optional. Only applies when deploying integrations using Standard Logic Apps. The Standard Logic App SFTP connector in Azure automatically caches SFTP connections by default, and will keep connections to the SFTP service open even after the Logic App has finished processing, for more efficient opening of the connection again in future Logic App runs. This caching service includes support for multiple connections being open. However, some SFTP services (especially in the banking sector) will enforce a maximum number of connections, and this caching feature can result in SFTP account lockouts. Set this value to true to disable this Standard Logic App feature, which will ensure that SFTP connections are closed at the end of each Logic App run. | |
actionRetryPolicy | Optional Logic App action retry policy to be applied to the relevant SFTP actions of the stage, to allow the default retry policy when performing SFTP actions to be overridden when needed. | |
filter | ||
fileName | If set, only ingest files that commence with the literal string segment provided. Does not support wildcards. The file name prefix matching is case insensitive. | |
fileSize | If set, do not ingest files of zero bytes. Only supports a value of zero. Recommended that this be set to zero, so that files in the process of being uploaded are not retrieved. | |
fileExtension | If set, only ingest files that have the specified file name extension. The file extension matching is case insensitive. | |
leaseLockName | Optional. See Lease Locking. | |
deleteSourceFile | Optional. Boolean flag to indicate if the stage will delete the file once ingested. Default value is true. | |
deduplicate | Inbound message de-duplication options, to allow incoming duplicate messages to be discarded. | |
timeWindow | The time window in which any duplicate payloads detected should be discarded. (Hours, minutes, and seconds.) | |
schemaMessageId | A filename that defines a Liquid transform, which will transform the received payload into a text string, which defines a unique ID for each message, allowing any duplicates of this unique ID received within the timeWindow to be discarded. | |
fileType | One of json, xml, or csv, defining the type of inbound file, so that the Liquid transform above can correctly handle the file transformation to the unique ID string. Only JSON, XML, and CSV files can be de-duplicated. | |
hasHeader | Required if fileType is csv. Set to either true or false to indicate if the CSV file has a header row or not. | |
lineEnding | Required when using the deduplicate feature, and when the fileType is set to csv. Set to either windows or unix.Defines if the Liquid transformation set by the deduplicate.schemaMessageId field (to transform the file into a unique ID value for the payload) should expect the CSV file being received to have Windows (\r\n) or Unix (\n) line endings. |
Pre-Logging Transformation
This stage supports the optional pre-logging transformation feature using the following fields:
preLogTransformSchemaFileNamepreLogTransformSchemaTypepreLogTransformFormat
See the Pre-Logging Transformation for details.
SSH Private Key Format
Please review the Microsoft documentation on the limitations of the built-in SFTP-SSH connector.
Azure does not accept SSH private keys in .ppk format. Please use .pem format for keys.
- Generate the SSH public and private keys.
- Use the SSH public key on the remote SFTP service.
- Use PuTTYgen (or an alternative) to convert the combined public and private keys from
.ppkfile to.pemfile format. See the following step-by-step instructions.
Once the key has been converted, Base64 encode the private key file, and use it as the sshPrivateKeySecretName value: the value of the Azure DevOps variable for an $env: token, or the value of the Key Vault secret for a $kv: token. See Stage Secrets.
An Azure DevOps variable can hold a maximum of 4,096 characters. The Base64 encoded value of an RSA SSH private key is longer than this, for example about 4,500 characters for an RSA 4096 key. For RSA keys, use a $kv: token for a Key Vault secret. An $env: token works for smaller keys, for example Ed25519 or ECDSA keys.
Last updated on