-
Notifications
You must be signed in to change notification settings - Fork 14
HTTP Actions and Chunking
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:
- the downloading of content using a HTTP GET operation will never be chunked because the mock HTTP server does not respond with a HTTP 206 status code.
- the uploading of content using HTTP PUT or HTTP POST operations would fail because the mock HTTP server does not respond with a HTTP 200 that includes the
Location
andx-ms-chunk-size
headers.
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!
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
- Home
- Using the Testing Framework
- Test Configuration
- Azurite
- Local Settings File
- Test Execution Logs
- Stateless Workflows
- Handling Workflow Dependencies
- Fluent API
- Automated testing using a DevOps pipeline
- Summary of Test Configuration Options
-
Example Mock Requests and Responses
- Call a Local Function action
- Invoke Workflow action
- Built-In Connectors:
- Service Bus
- SMTP
- Storage Account
- SQL Server