GOPI
GOPI

Reputation: 71

Azure Functions: Is there any way to handle TimerTrigger from Azure SDK?

I am looking for a simple Scheduler to execute a task inside my Java web application deployed in Azure cloud. I am evaluating Azure functions with TimerTrigger for my requirement. Here, I am planning to define a Azure function with a callback API URL to invoke my application for executing the task inside my application.

I have some queries in this approach. Can anyone help me If you are familiar with Azure functions please?

1) Is it possible to initiate/reschedule/cancel a Azure TimerTrigger function from a Java application through API at runtime?

2) If yes, Is it possible to pass a call back URL to the timer Trigger?

3) Is there any known drawback in using Azure functions?

Thanks!

Upvotes: 0

Views: 802

Answers (1)

Matt Mason
Matt Mason

Reputation: 2724

TimerTriggers don't have an api to control this (you could try to hack one in by uploading a new function.json with the schedule you want and whether or not the timer is disabled, but I don't recommend that at all).

Instead, I'd suggest using a QueueTrigger. This would allow you to pass the function any data you need in the queue item (the callback url) and you could add items to the queue with a visibility timeout in order to create your schedule. If you need to cancel pending executions, just remove the item(s) from the queue. The function is also more durable - if a queue item fails, it will automatically retry (unlike timers).

3) is way too broad of a question to have an answer.

Upvotes: 5

Related Questions