Currently, it seems not possible to send all the proper HTTP responses from Azure function through the CloudScript endpoint.Errors and redirects get lost.
The workaround that is commonly suggested is to always return a OK response with a JSON body like:
{ "code": 404, "result": "error", "message": "Request not found" }
But this is super annoying to deal with on the client-side. ( You're getting an error that is not sent as an error ).
Ideally, we can just proxy through some responses, like errors, redirects, and ( stretch goal ) maybe even download streams?