Home > database >  Schedule ASP.NET API to run once
Schedule ASP.NET API to run once

Time:12-08

I have WebAPI developed in .NET 6.0 and deployed into AKS. I would like to schedule & run once the API.

What scheduling tools / libraries are available to schedule (run once) the API call other than Azure LogicApp?

Could you share any ideas to achieve this?

CodePudding user response:

There are a couple of options:

1. Hangfire

Hangfire is an open-source library that allows you to schedule jobs in an Asp.Net application. It requires a database or Redis to store the scheduled jobs.

The good thing about Hangfire is that you can build API endpoints in your Asp.Net application to manage the schedule and see the result of the runs.

2. AKS Cronjob

If you don't want to use a database or Redis, you can create an AKS Cronjob, which is managed by AKS.

At work, we use Hangfire but have been considering moving to AKS cronjob as less code to maintain in the application.

  • Related