Azure / Azure/azure-functions-host

Azure function is invoked but the code is never executed

Open
#2,151 11 comments 0 reactions 1 assignee Claimed by @pragnagopa View on GitHub
Dominant language
C#
Stars
2k
Forks
482
Avg merge
2d 10h
Merged PRs (30d)
36

Description

_From @dixitsuneel on November 20, 2017 18:40_

I can see in the monitoring log that the azure function is getting invoked.
But the code never receives the control for execution.

But if I hit the same http request to the function multiple times, then it starts working correctly after couple of tries.

I know that the control is never received by my code as the first line I have in my function app is context.log.info and that doesn't get executed.

What do we have to do to fix the issue?

Here's the screen shot where you can see multiple requests not completing and the logs section is empty for the selected request(2nd from the top)
![request not completing](https://user-images.githubusercontent.com/12703917/33035099-fee90d10-cdf7-11e7-9c1e-7682cb2abf61.PNG)

Here's the screen shot of the first request which completed and you can see the log
![request complete](https://user-images.githubusercontent.com/12703917/33035161-2b5f6f6a-cdf8-11e7-93ae-c7495b6f4f21.PNG)

I have also added global exception handling, just in case there is an exception then that method will terminate the context with an error.

Here's the code for the same
process.on('uncaughtException', function (err) {
context.log.error(err);
context.done(err);
});
There is no logging at all. Please help

_Copied from original issue: Azure/Azure-Functions#601_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.