An HTTP 411 Length Required error usually means the request reached Log Analytics without a valid payload size. In Power Automate, this often happens when the Send Data action cannot properly interpret the body.
A few things to check:
1. Use a JSON array: The Log Analytics API expects an array, even for a single record. For example:
[
{
"LogMessage": "Test",
"Status": "Success"
}
]
2. Ensure the body is correctly parsed If you are passing dynamic content, wrap it to make the type explicit:
json(body('Compose'))
or
string(outputs('YourData'))
3. Avoid empty inputs If the payload is null or empty, the connector may send a zero-length request, which triggers this error. Add a check before calling the action.
In most cases, fixing the payload structure or casting the input resolves the issue without needing to switch to the HTTP action.
✅ If this answer helped resolve your issue, please mark it as Accepted so it can help others with the same problem.
👍 Feel free to Like the post if you found it useful.
Sunil Kumar Pashikanti, Moderator
Blog: https://sunilpashikanti.com/posts/