Handlers

Your service can be triggered in five different ways where the REST handler is the most common one. The "Example - Code" and "Example - Projects" sections contain examples on how to use the different handlers.

REST Handler

See the REST chapter for more information. See the "Example - Projects" section for a complete example named "Hello World".

GraphQL Handler

See the GraphQL chapter for more information. See the "Example - Projects" section for a complete example named "GraphQL".

Scheduled Handler

The service can be triggered from an automated schedule using cron expressions.

The BaaS cron expression consists of five space-separated values _"Minutes Hours Day-of-month Month Day-of-week"_.

The cron expression for the deployed service is defined in the service manifest, and the local debug expression is defined in local.settings.json.

The service is run on the second zero of the specified minute, and the granularity spans from minutes to yearly. Time is specified in UTC and 24 hour format.

The baas-manifest.json and local.settings.json files contain a tooltip with a dynamic verbose description of the current cron expression.

There is also a command to set the service cron expression. Press F1 key and select "BaaS - Set Schedule Expression in Service Manifest".

[Schedule expressions](https://en.wikipedia.org/wiki/Cron#CRON_expression)  

Storage Handler

The service can be triggered for data changes in the storage to perform many types of file processing tasks. See the "Example - Projects" section for a complete example named "Storage Trigger".

Queue Handler

The service can be triggered from a queue and process arriving messages. See the "Example - Projects" section for a complete example named "Asynchronous Job".