Timeout value of 00:05:00 was exceeded by function: Functions.MyFunc.
See original GitHub issueI’m trying to setup a function app using script, steps are listed below.
Repro steps
Provide the steps required to reproduce the problem
-
Create dynamic function app using json template
-
Setting environment variable (some connection string) through Azure CLI 2.0
-
Create a folder as a function name under site/wwwroot/ (Kudu REST API)
-
Upload files into the created folder (through FTP)
-
run “npm install” (Kudu REST API)
My function code:
'use strict';
const Client = require('azure-iothub').Client;
const Message = require('azure-iot-common').Message;
const iotHubConnectionString = process.env['speech-recognition-iothub'];
module.exports = function (context, myEventHubMessage) {
context.log(myEventHubMessage);
if (myEventHubMessage.DeviceID) {
const cloudClient = Client.fromConnectionString(iotHubConnectionString);
cloudClient.open(function (err) {
if (err) {
console.log('Could not connect: ' + err.message);
} else {
console.log('Client connected');
const message = new Message(`Pong - ${new Date().toTimeString()}`);
cloudClient.send(myEventHubMessage.DeviceID, message, function (err, res) {
if (err) {
context.log(`Error in send C2D message: ${err}`);
} else {
context.log(`send status: ${res.constructor.name}`);
}
});
}
context.done();
});
}
};
Actual behavior
Then I send some msg to my IoT Hub. The function app is keeping logging “function app start”
logs can be seen here,
Actually, if I do nothing, the function app still keeps logging “function app start”
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Timeout value of 00:05:00 was exceeded by function in ...
Azure Functions are now allowed to run upto 10 minutes. You need to change the "functionTimeout" value in host.json file.
Read more >Azure Functions: Timeout value of 00:05:00 exceeded by ...
When running Azure functions, I encountered the following error: 2021-09-17T08:13:47.525 [Error] Timeout value of 00:05:00 exceeded by ...
Read more >Azure function not running successfully. - Microsoft Q&A
Host: Timeout value of 00:05:00 was exceeded by function: 'MY_FUNCTION_NAME.' For the above error, I have raised the timeout value from default ......
Read more >Timeout value of 00:30:00 exceeded by function
Hello everyone, I have a function in azure that saves the Exchange messagetarce however in some cases the duration time is greater than...
Read more >Azure Functions: Extend Execution Timeout Past 5 Minutes
json I have given timeout value to 2 hours, but it was failing with error “Timeout value of 02:00:00 was exceeded by function:...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@jdneo, could you try changing your Function to process the EventHub messages in batches? You can do so with the following 2 steps:
A similar Function setup can be found at: https://github.com/Azure/azure-webjobs-sdk-script/tree/dev/sample/EventHubTrigger
Thank you guys! According to your suggestion, I figure out the mistakes I made:
e.g.
Put the context.done() inside the callback function can make the ‘function complete’ log always show in the last step of the function execution
Thank you again!