Timer triggers allow you to execute Azure Functions on a schedule. This page provides an overview and examples for creating and configuring timer triggers.
Learn More on DocsThis example demonstrates a basic timer function that executes every 5 minutes.
function (context) {
var timer = context.req.time;
console.log('Timer triggered: ' + new Date());
context.res.writeHead(200);
context.res.write('Hello from Azure Functions Timer!');
context.res.end();
}
The context
object provides access to various resources, including:
context.req
: Contains information about the incoming request.context.res
: Allows you to send a response.context.log
: Used for logging messages.context.time
: Provides the current time for scheduling.You can configure timer triggers by setting the following parameters:
Refer to the documentation for more details on configuring timer triggers.