how to run a nodejs file on azure function using a cron job?

Viewed 33

I have a nodejs file indexjs. How do I run it using azure functions. I mean I see this auto generated file I got from time tiggers but how do I directed to run the file.

like node index.js

This is the file I have

{
    "bindings": [
        {
            "name": "myTimer",
            "type": "timerTrigger",
            "direction": "in",
            "schedule": "0 */5 * * * *"
        }
    ]
}
1 Answers

You probably want to follow the documentation to create an Azure function here for CLI or here for vs code. Once you create a function within your function app it will automatically create an index.js file that you can edit the code in. Replace what's in the index.js with the code you already have and you should be good to go.

Related