Matt Hernandez 023c4817a2 Update Azure documentation.
Cleaned up the formatting, corrected some typos, updated the credentials
guide to cover interactive login, and cleaned up the quick start.
2017-06-09 14:55:54 -07: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();
};