Why Azure functions http trigger post api response is blank but the success code is 200 ok ?

Avneet Singh 0 Reputation points
2024-05-29T22:49:44.3266667+00:00

Why Azure functions http trigger post api response is blank but the success code is 200 ok ? It works locally with the response message

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,678 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Deepanshukatara-6769 8,060 Reputation points
    2024-05-30T05:53:29.49+00:00

    Hi Avneet,

    The return type of the Azure function has to be a valid JObject. (Keep in mind that JArray is not a JObject.) Any return type other than JObject fails and raises the user error Response Content is not a valid JObject.

    https://learn.microsoft.com/en-us/azure/data-factory/control-flow-azure-function-activity#azure-function-linked-service

    Feel free to reach out to me if you have any questions or concerns.

    Thanks

    Deepanshu

    0 comments No comments

  2. SwathiDhanwada-MSFT 18,556 Reputation points
    2024-05-30T07:40:00.76+00:00

    @Avneet Singh The default return value for an HTTP-triggered function is:

    • HTTP 204 No Content with an empty body in Functions 2.x and higher
    • HTTP 200 OK with an empty body in Functions 1.x

    To modify the HTTP response, you need to configure an output binding.

    0 comments No comments