1

Im wanting to run a function every day at midnight. i've been looking but i think azure provides this service for you. Are webjobs the correct service to use? can i call my database to delete any records before the todays date?

I've seen Quartz but if azure provides this feature i dont see the point. thanks

Costas Aletrari
  • 387
  • 5
  • 22

3 Answers3

0

It depends on where your database is - is it on prem, an Azure SQL database or on a Azure VM?

If it is on prem or on a VM then a SQL Job might be the best option.

Otherwise, provided your web app can access the database, then a webjob would be a good option to use. You can schedule it using the built in sheduler on Azure or use a CRON expression. See here for details on how to do these.

majita
  • 1,278
  • 14
  • 24
0

To execute recurring jobs on a database, you can use an "Azure Function App" with a TimeTrigger function. You can find an example in the answers of this related question : How to truncate SQL database on Microsoft Azure periodically

Community
  • 1
  • 1
Thibaut Ranise
  • 705
  • 4
  • 12
0

If you don't have to do complex scheduling, Quartz.net seems a bit like overkill to me.

Did you consider Azure automation? It gives you free retries, alerting, and a webhook URI for ad-hoc execution

Henry Been
  • 363
  • 2
  • 12