Christopher Anderson b3659a45d2 Adding initial Azure Docs 🎉
2017-02-20 01:03:41 -08:00

1.2 KiB

Read this on the main serverless docs site

Timer Trigger

Azure Functions Timer trigger lets you listen on Azure Timer. Full documentation can be found on azure.com.

Timer Events

Timer Trigger

This setup specifies that the hello function should be run every 5 minutes

Here's an example:

# serverless.yml

functions:
  example:
    handler: handler.hello
    events:
      - timer: 
        x-azure-settings:
            name: item #<string>, default - "myQueueItem", specifies which name it's available on `context.bindings` 
            schedule: 0 */5 * * * * #<string>, cron expression to run on
// handler.js

'use strict';

module.exports.hello = function(context, timerObj) {
  context.log("Timer ran");
  context.done();
};