Node.js v4 Azure Function POST returns empty 404 while GET works on the same Flex Consumption app

Ade Jabar 0 Reputation points
2026-10-12T00:11:24.7633333+00:00

Environment:

  • JavaScript, Node.js 24
  • Azure Functions programming model v4
  • @azure/functions 4.16.5
  • Linux Flex Consumption, UK South
  • Easy Auth requiring authenticated application tokens

CREATE registration:

app.http("guardCreateObject", {

methods: ["POST"],

authLevel: "anonymous",

route: "guard/objects",

handler: async (request, context) => { /* handler */ }

});

host.json has routePrefix: "api".

Observed during a controlled test on 11 October 2026:

  1. Management-plane checks reported the CREATE disable setting as false and the function's isDisabled property as false.
  2. The registered invoke URL matched the requested URL exactly.
  3. An authenticated GET to another route on the same hostname returned the application's expected JSON response.
  4. Immediately afterwards, POST /api/guard/objects returned: HTTP 404 Server: Kestrel Content-Length: 0 Empty response body.

The POST used application/json with:

{"correlation_id":"cfos-body-evidence"}

The handler should return JSON 428 for the deliberately omitted

If-None-Match header, or JSON 400 if body parsing fails. Both checks

precede storage access. The reviewed CREATE handler has no 404 branch.

The function is listed in Azure with POST and route guard/objects.

All write functions were restored disabled after the test.

What could explain the discrepancy between management-plane enablement

and the runtime POST response? What read-only host evidence would

distinguish routing, stale disable state, or runtime metadata issues?

If trigger synchronisation is appropriate, please identify the

supported operation specifically for Flex Consumption.

Azure Functions
Azure Functions

An Azure service that provides an event-driven serverless compute platform.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Rukshan edirisinghe 1,480 Reputation points
    2026-10-12T08:23:02.3266667+00:00

    Hi @Ade Jabar

    A detail in your post stands out: the write functions were disabled before the test and switched back to disabled right after. Enable and Disable in Azure Functions are just the AzureWebJobs.<FUNCTION_NAME>.Disabled app setting, and Microsoft's docs say changing an app setting restarts the function app by default. If your POST landed on a host that was still running with the old "disabled" setting, an empty Kestrel 404 is what you'd expect, since the function simply isn't loaded there. That fits your result even though the management plane already showed it as enabled.

    To confirm it from the host side, without changing anything:

    1. In Application Insights, look at the traces around the test. Find the most recent host startup before your POST and check whether guardCreateObject is in the list of functions that host loaded, or whether it was logged as disabled.
    2. Compare the timestamp of that host startup with the time of the app setting change. If the POST came first, it's a timing issue and not a routing or metadata problem.
    3. For the next test, enable the function, wait until you see a new host startup in the traces with the function loaded, and only then send the POST.

    If the host clearly loaded the function and the POST still gets an empty 404, that points to something deeper, and a support case with the invocation timestamps would be the next step.

    Roughly how many seconds passed between enabling the function and sending the POST?

    If this resolved your issue, please consider accepting it as the answer. If the traces show something different, let me know and I'll be happy to keep helping.

    Reference:

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.