Search code examples
abp-framework

Anyone able to use Abp.io background tasks with azure webjobs


I'm looking to use abp.io and azure webjobs or functions to create a job scheduler for many jobs. Each job would be in a module and have its own settings for how often to run the background task. Wondering if anyone has successfully done this already?


Solution

  • Yes, I have done that. We have an .Net core console application created with an ABP template that does all the long-running background jobs. I struggled with it for a while but got it working. The trick was to publish the project directly into a path that the app service uses to find runnable web jobs. We are using azure DevOps where the publish configuration looks like this: --configuration $(BuildConfiguration) --self-contained -r win10-x64 --output $(Build.BinariesDirectory)/publish_output/App_Data/jobs/continuous/background-process-manager.

    It is also now possible to use the ABP framework with Azure functions. This can be achieved using the isolated mode: https://learn.microsoft.com/en-us/azure/azure-functions/dotnet-isolated-process-guide. This works if you don't want to use the ABP background jobs triggered from another application. In our case, we wanted to run long-running background jobs triggered either on schedule or by our web application. Using the ABP background job structure required us to run the background process manager as a continuous web job.