How do i read the http status of a http trigger function built using Azure Functions v4?
The equivalent in v3 would have been something like
const statusCode = context.res.status;
context.log(HTTP Status Code: ${statusCode}
);
I've tried debugging and trying to find the status amongst the context variables but i understand it's not there. I can see from the documentation (https://learn.microsoft.com/en-us/azure/azure-functions/functions-node-upgrade-v4?tabs=v3) that you can set the status using a return status e.g. return { status: 200 }; but i don't know how to simply read the current status.
Thanks!
I have created a Http triggered function.
code:
The above code executed successfully. Output status in Local:
I have successfully deployed the http trigger function into Azure portal. check below:
Then click on the function, go to
code+test
, and run the code. It runs successfully, and the status is below: Output: