Klevr Product Documentation logo

Outbound Azure File Storage Stage

The Outbound Azure File Storage stage allows text-based messages to be exported to an Azure File Storage service.

Stage Overview

The Outbound Azure File Storage stage allows text-based messages (e.g. JSON, XML, or plain text [including CSV files]) to be exported from the Integration Hub service to an Azure File Storage service.

For sending binary-based messages to an Azure File Storage service, see the Outbound Azure File Storage Binary stage.

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

Stage Definition File Location

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

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

Stage JSON Definition File Format

The JSON definition file for an Outbound 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>",
  "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,
  "externalStorageAccount": {
    "accountName": "$env:AFS_ACCOUNT_NAME",
    "accessKey": "$env:AFS_ACCESS_KEY",
    "folderPath": "$env:AFS_FOLDER_PATH"
  },
  "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 Azure File Storage service. 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.
externalStorageAccount
accountNameThe name of the Azure File Storage service to upload the file to. 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 upload the file to.
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 Azure File Storage, 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 Azure File Storage service.

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

Last updated on