-1

I have small doubt

I have one function app with Httptrigger function .I want to invoke this function app on every 5 miutes ? automatically this should happen

If it is supposed to be possible May i know how can we acheive this?

Any help is appreciated

1 Answers1

0

You can create a TimerObject to get a cron like a feature integration in place for function calls. You can define your new object as a JSON body such as one below:

{
    "schedule": "*/5 * * * *",
    "name": "myTimer",
    "type": "timerTrigger",
    "direction": "in"
}

This can then be plugged into the function body as:

module.exports = function (context, myTimer) {
    var timeStamp = new Date().toISOString();

    if (myTimer.IsPastDue)
    {
        context.log('Node is running late!');
    }
    context.log('Node timer trigger function ran!', timeStamp);   

    context.done();
};

More info available here from the official docs

Raunak Jhawar
  • 1,541
  • 1
  • 12
  • 21
  • sorry I am not understanding where should i do these are all things.If you dont mind Could you explain Clearly? otherwise it is better if there is any documentation regarding on this – Narsingrao Mar 20 '19 at 11:52
  • Small doubt Is the above code belong to javascript? If it si supposed to belongs to javascript can we integrate this one in c# code – Narsingrao Mar 20 '19 at 13:46
  • There are other frameworks also available in the official docs including C#. Have a look there once. – Raunak Jhawar Mar 20 '19 at 13:53