Klevr Product Documentation logo

Inbound File Share Stage

The Inbound File Share stage allows messages to be ingested into Integration Hub by monitoring a Windows file share location for the creation of new files.

Stage Overview

The Inbound File Share stage allows messages to be ingested into Integration Hub by monitoring a Windows file share location for the creation of new files.

The Inbound File Share stage was added in Integration Hub v6.0.0.

Stage Definition File Location

All Inbound File Share stages are defined by creating an appropriately formatted JSON definition file in the following location:

interfaces
{businessUnitCode}
{domainCode}
{integrationName}
in
fs
{STAGE_NAME}.json

Stage JSON Definition File Format

The JSON definition file for an Inbound File Share 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": {
    // See Inbound Timer stage
  },
  "enableVnet": true,
  "fileSystemDetails": {
    "apiConnectionName": "$env:FILE_SHARE_CONNECTION_NAME",
    "authenticationType": "windows",
    "username": "$env:FILE_SHARE_USERNAME",
    "password": "$env:FILE_SHARE_PASSWORD",
    "rootFolder": "$env:FILE_SHARE_ROOT_FOLDER",
    "folderPath": "$env:FILE_SHARE_FOLDER_PATH",
    "gateway": "$env:FILE_SHARE_GATEWAY"
  },
  "filter": {
    "fileName": "CTPO",
    "fileSize": 0,
    "fileExtension": "txt"
  },
  "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"
}
PropertySub-PropertyDescription
nameThe name of the stage.
displayNameOptional (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.
descriptionOptional (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.
enabledOptional boolean flag (true or false). Default is true.

Generally set via a DevOps variable. Controls if the stage is deployed enabled or not.
recurrenceRequired object defining how often the external file share service should be checked to see if new files have been uploaded.

The supported options are the same as the Inbound Timer stage.
enableVnetOptional. Boolean flag to indicate if the file share 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.
fileSystemDetails
apiConnectionNameA unique "name" that will be used (along with other information like the environment, region, Business Unit, etc.) to create an "API Connection" resource, that will actually be the connection to the file share.

Can be reused across multiple integrations to reduce the number of times the "API Connection" resource needs to be created.

Generally set via a DevOps variable.
authenticationTypeThe authentication type to use to connect to the file share. Must be set to windows.
usernameThe username that will be used to authenticate to the file share. For example, DOMAIN\Username. Generally set via a DevOps variable.
passwordThe password that will be used to authenticate to the file share. Generally set via a DevOps variable.
rootFolderThe root of the file share. For example, \\MACHINE\myShare or C:\.
folderPathThe file share folder path following on from the rootFolder.
gatewayOptional. On-premises file shares without a directly accessible hostname/IP address need to be accessed via an on-premises data gateway resource. If this is required, set this parameter to the Azure Resource ID of the resource, e.g. /subscriptions/{subscription_id}/resourceGroups/{resource_group}/providers/Microsoft.Web/connectionGateways/{resource_name}
filter
fileNameIf set, only ingest files that contain the literal string segment provided. Does not support wildcards. The file name matching is case insensitive.
fileSizeIf 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.
fileExtensionIf set, only ingest files that have the specified file name extension. The file extension matching is case insensitive.
deleteSourceFileOptional. Boolean flag that indicates if the source file should be deleted from the File Share service once retrieved. Default value is true.
deduplicateInbound message de-duplication options, to allow incoming duplicate messages to be discarded.
timeWindowRequired when using the deduplicate feature. The time window in which any duplicate payloads detected should be discarded. (Hours, minutes, and seconds.)
schemaMessageIdRequired when using the deduplicate feature. 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.
fileTypeRequired when using the deduplicate feature. 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.
hasHeaderRequired if fileType is csv. Set to either true or false to indicate if the CSV file has a header row or not.
lineEndingRequired 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:

  • preLogTransformSchemaFileName
  • preLogTransformSchemaType
  • preLogTransformFormat

See the Pre-Logging Transformation for details.

As Azure doesn't provide a trigger for detecting new files on the file share service, this stage is executed based solely on the recurrence settings. As a result, the stage will execute as often as defined in the recurrence settings, not only when a new file is added to the file share service's monitored folder.

Last updated on