enableHttpStream: true
I use Azure a decent amount and I like Azure Functions. Recently, I was building a function for a partner to call as a webhook and when we were testing it the payload was always empty. For a sanity check, I used VS Code to port forward to my local machine and I had him call it instead. I received the data just fine. What. The. Heck.
I added more logging and I discovered that one of the headers I was receiving was
Transfer-Encoding: chunked
I was unfamiliar with this. This is one of those details that just works inside most of the black-boxes and you never see it. By default, Azure Functions does not support it. And apparently, it's failure state is to just accept the request and give you an empty body... which is just delightful for debugging.
Here's the solution:
import { app } from '@azure/functions';
app.setup({ enableHttpStream: true });
That's it. Problem solved. I just added that next to file where I'm creating the http trigger that is impacted, but it does take effect for the entire app, not just the one function, so you can organize it however you'd like.