Skip to content

HTTP Actions and Chunking

MarkAbrams edited this page Oct 24, 2023 · 1 revision

The built-in HTTP action supports the upload and download of large messages using chunking, which splits a large message into multiple smaller messages. Logic Apps implements chunking for HTTP actions using its own protocol which means that the service endpoint that is being called by a HTTP action must also support the same Logic App chunking protocol. When running unit tests, the service endpoint is the mock HTTP server that is managed by the testing framework.

Chunking for an HTTP action is enabled by adding the runtimeConfiguration.contentTransfer.transferMode property to the HTTP action in the workflow definition:

"HTTP_Get_Action": {
    "type": "Http",
    "runtimeConfiguration": {
        "contentTransfer": {
            "transferMode": "Chunked"
        }
    }
}

In the workflow designer this is shown as the Allow chunking option.

The mock HTTP server that is created by the testing framework does not support the chunking protocol. This means that when testing workflows that have HTTP chunking enabled:

To fix the issue with uploading content, the testing framework can be configured to update a workflow definition to remove the chunking configuration. Note that changing the chunking configuration in a HTTP action does not change the functionality or behaviour of the workflow, it simply configures how the workflow runtime interacts with a service endpoint to exchange large messages.

Author's note: The testing framework could be changed to implement the Logic App chunking protocol when uploading content using the HTTP PUT and HTTP POST operations. However, for reasons that are not fully understood, the change only worked with the Windows and Linux (Ubuntu) operating systems and did not work with MacOS. This is documented in GitHub Issue 24. In order to keep a consistent set of features across all operating systems, this solution was not implemented. However, if anyone thinks that the implementation of the Logic App chunking protocol for the Windows or Linux operating systems is important, I can reconsider!

Remove Chunking Configuration

The removal of the chunking configuration (the runtimeConfiguration.contentTransfer.transferMode property) for HTTP actions can be enabled or disabled using the workflow.removeHttpChunkingConfiguration option in the testConfiguration.json file:

"workflow": {
  "removeHttpChunkingConfiguration": true
}

The setting is optional. If it is not included, the default value is true.

The test execution log will include logging to show which HTTP actions have been updated:

Updating workflow HTTP actions to remove chunking configuration:
    Get_Action
    Post_Action
Clone this wiki locally