Klevr Product Documentation logo

Outbound File Share Stage

The Outbound File Share stage allows text-based messages to be exported to a Windows file share.

Stage Overview

The Outbound File Share stage allows text-based messages (e.g. JSON, XML, or plain text [including CSV files]) to be exported from the Integration Hub service to a Windows file share location.

For sending binary-based messages to a Windows file share location, see the Outbound File Share Binary stage.

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

Stage Definition File Location

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

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

Stage JSON Definition File Format

The JSON definition file for an Outbound File Share stage is as follows:

{
  "name": "stage-name",
  "displayName": "Brief Stage Title",
  "description": "Brief description of the stage.",
  "enabled": "$env:STATUS_<INTEGRATION_NAME>",
  "source": "source-event",
  "concurrency": 10,
  "schemaFilename": "schemas/path/to/schema/schema-name.liquid",
  "expectedFiletype": "txt|json|xml|csv",
  "hasHeader": false,
  "delimiter": "|",
  "lineEnding": "windows|unix",
  "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"
  },
  "emitEvent": "previous-stage-name-1",
  "emitError": false,
  "emitErrorTerminateSuccess": false,
  "leaseLockName": "lock-name",
  "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.
sourceThe source event that the stage subscribes to. See Pub/Sub Model.

Alternatively, sources may be supplied, and an array of one or more source events can be subscribed to.
concurrencyOptional number of concurrent runs permitted for the stage. Default is 10.
schemaFilenameA filename that defines a Liquid transformation schema. See the Transform Liquid Stage for more details on Liquid transformation schema file location and format requirements.

The Liquid transformation schema is used to generate the filename that will be created on the remote file share. This approach allows the filename to contain both static content (hard-coded in the Liquid schema) and/or dynamic content based on the date/time of filename generation and/or content in the file being uploaded to the file share.
expectedFiletypeSpecifies the expected outbound file type being uploaded to the remote Windows file share location. One of txt, json, xml, or csv.

When the Liquid transform specified in the schemaFilename field needs to access the file contents to generate the filename, this field is required, to ensure that the file contents can be parsed successfully and made available to the Liquid transform.

If the Liquid transform does not need to access the file contents to generate the filename, then this field does not need to be set.
hasHeaderRequired only when the expectedFiletype value is txt or csv.

Either true or false. In the event that the file content being uploaded is either a CSV file, or delimited text content, and has a header row, this must be true to allow the Liquid transformation schema defined in schemaFilename to be able to parse the file contents when generating the filename to be used for uploading the file.
delimiterRequired only when the expectedFiletype value is txt or csv.

In the event that the file content being uploaded is either a CSV file, or delimited text content, this must be supplied to define the file's delimiter character, to allow the Liquid transformation schema defined in schemaFilename to be able to parse the file contents when generating the filename to be used for uploading the file.
lineEndingRequired only when the expectedFiletype value is txt or csv.

Set to either windows or unix. Defines if the Liquid transformation set by the schemaFilename field (to create the filename of the file to be created on the remote service) should expect the text or CSV file being transformed to have Windows (\r\n) or Unix (\n) line endings.
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 share locations 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}
emitEventWhen the upload to the remote file share is successful, the stage will normally terminate. However, under certain circumstances, it may be desirable to continue workflow processing.

The optional emitEvent flag allows the payload of a previously run stage to be output as a message from this stage. The stage must have previously been executed in the run history of the overall Integration Hub integration, with the stage's exported payload details being present in the Cloud Event Attributes section.
emitErrorOptional boolean flag (true or false). Default is false. When true, the stage will capture and emit a payload if a non-retryable error is detected, or if a retryable error is detected on the final retry attempt. See the Emit Error Payload section below for more details.
emitErrorTerminateSuccessOptional boolean flag (true or false). Default is false. When true, and when emitError is also true, the stage will terminate with a Successful state, rather than a Failed state, in the event of an error being detected and emitted.

When the stage is configured to operate in this way, the integration should be defined so that a subsequent stage, or series of stages, will be triggered by the emitted error payload to "handle" the error condition in such a way that reporting and alerting on the error (as would happen if the stage terminated with a Failed state) is unnecessary.
leaseLockNameOptional. See Lease Locking.

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.

Emit Error Payload

In the event that the emitError option has been set to true and:

  • a non-retryable error is detected when calling the external Windows file share; or
  • a retryable error is detected on the final retry attempt

then the stage will emit an error payload.

There is no defined format for the error payload that is emitted, as it depends on the Windows file share service.

The event used to emit the payload will be the full stage name with -error appended, e.g. out-fs-stage-name-error.

Last updated on