Klevr Product Documentation logo

Inbound Azure File Storage Stage

The Inbound Azure File Storage stage allows messages to be ingested by monitoring an Azure File Storage folder for new files.

Stage Overview

The Inbound Azure File Storage stage allows messages to be ingested into Integration Hub by monitoring an Azure File Storage service for the creation of new files.

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

Stage Definition File Location

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

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

Stage JSON Definition File Format

The JSON definition file for an Inbound Azure File Storage stage is as follows:

{
  "name": "stage-name",
  "displayName": "Brief Stage Title",
  "description": "Brief description of the stage.",
  "enabled": "$env:STATUS_<INTEGRATION_NAME>",
  "recurrence": {
    // See Inbound Timer stage
  },
  "enableVnet": true,
  "externalStorageAccount": {
    "accountName": "$env:AFS_ACCOUNT_NAME",
    "accessKey": "$env:AFS_ACCESS_KEY",
    "folderPath": "$env:AFS_FOLDER_PATH"
  },
  "filter": {
    "fileName": "CTPO",
    "fileSize": 0,
    "fileExtension": "txt"
  },
  "deleteSourceFile": true,
  "skipDeleteIfNotExist": false,
  "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 Azure File Storage 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 Azure File Storage 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.
externalStorageAccount
accountNameThe name of the Azure File Storage service to monitor for new files. Generally set via a DevOps variable.
accessKeyAn access key that has permission to connect to the Azure File Storage service. Generally set via a DevOps variable.
folderPathThe folder path in the Azure File Storage service to monitor for new files.
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 Azure File Storage service once retrieved. Default value is true.
skipDeleteIfNotExistOptional. Boolean flag that indicates if the deletion of the source file from the Azure File Storage service (if enabled via the deleteSourceFile flag) should be skipped if the source file is no longer found when attempting the delete step. (If the feature is not set to true, and the source file no longer exists when attempting to delete the source file, the stage will terminate with a Failed status.) Default value is false.
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 Azure File Storage 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 Azure File Storage service's monitored folder.

Last updated on