I am using this tutorial to create azure durable function https://docs.microsoft.com/en-us/azure/azure-functions/durable/quickstart-js-vscode
Note:- I am using premium plan
host.json
{
"version": "2.0",
"logging": {
"applicationInsights": {
"samplingSettings": {
"isEnabled": true,
"excludedTypes": "Request"
}
}
},
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "[3.*, 4.0.0)"
},
"functionTimeout": "00:40:00"
}
Hello/index.js
function delay(sec) {
let now = Date.now();
// run while loop for - sec
while (now + sec * 1000 > Date.now());
}
module.exports = async function (context) {
context.log("I am starting.");
const startTime = new Date().toLocaleTimeString();
// simulating a long-running task
delay(5 * 60);
const endTime = new Date().toLocaleTimeString();
return `${context.bindings.name} - ${startTime} -> ${endTime}`;
};
Sometimes call to the function HelloOrchestrator is working fine, but sometimes it responds with 504 gateway timeout.
What could be the issue?