0

In my job we are building Web Apps that rely on a common Enterprise class. This class has a method that sends a request to our server every time the app_start or app_end event triggers so we can monitor the status remotely. But we are now requiring that at least once a day the web app reports its status, a bit like telemetry. I don't know how to accomplish this, so far I have found some options, but some have limitations:

  1. Use hangfire. I don't like this since it requires to setup a Database or add more tables and install a new Nuget package on each project, but could be my last option.

  2. Use a Windows Service that reads databases. This could be less work but it can't access the Web App web.config code

  3. Use a Javascript tasks that sends an AJAX request. This requires to have an open web browser and is a big risk.

I'm looking for a server side approach that could allow to set to trigger an event or function at 1am.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
David Ortega
  • 915
  • 9
  • 25

2 Answers2

0

I would got with Hangifire.

It is dead easy to setup and very reliable. You don't need to setup the database, you might want to check memory storage:

https://github.com/perrich/Hangfire.MemoryStorage

Also check:

What is the equivalent to CRON jobs in ASP.NET? - C#

Artur Kedzior
  • 3,994
  • 1
  • 36
  • 58
0

You can use FluentScheduler instead of Hangfire (it is more lightweight).

Instead of a Javascript task that sends an AJAX request you can use a WebJob or an Azure Function.