Run a scheduled job in Azure app service using Quartz.net

Joby Joby 0 Reputation points
2024-07-25T16:09:06.29+00:00

Hi,

I am using a .Net console app (A) deployed in Azure app service to run a scheduled job using Quartz.net library. The job is configured to execute another .Net console executable (B) during the trigger. But executable(B) randomly stops execution in the middle. I also see "Hosting Starting" message in app service log every 3 minutes. Appreciate any guidance on this.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,970 questions
Developer technologies | .NET | Other
Developer technologies | C#
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Achraf Ben Alaya 1,311 Reputation points MVP
    2024-08-01T06:25:28.2+00:00

    Hello ,

    the issue you are facing can be related to different issues, your app service may be timout or restarts,try to scale up or out your app service and test again .

    maybe also there is some exceptions that you are not seeing for that you may need to enable :

    1-loging and monitoring : https://learn.microsoft.com/en-us/azure/app-service/monitor-app-service?wt.mc_id=MVP_328341
    2- env configuration
    3- Permissions

    By the way,app services are not designed to run long-runing background processes , you may want to look to

    1- Azure functions with time trigger :https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-timer?tabs=python-v2%2Cisolated-process%2Cnodejs-v4&pivots=programming-language-csharp?wt.mc_id=MVP_328341

    2- WebJobs : https://learn.microsoft.com/en-us/azure/app-service/webjobs-create?wt.mc_id=MVP_328341&tabs=windowscode

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.