I am trying to add a webjobs after creating and configuring a web app. But the webjobs tab is disbled
Asked
Active
Viewed 3,999 times
1 Answers
5
Actually, WebJobs feature is only support in Azure WebApp for Windows, not for Linux on Container. So if you want to use Azure WebJobs, please first to create an instance of Azure App Service for Windows, then to refer to the offical document Run Background tasks with WebJobs in Azure App Service
to add your webjob.
For Linux on Container, to realize two types of WebJobs: continuous and triggered, I have some suggestions for you as below.
- For continuous webjob, it just run webjob logic code in a loop. You only need to run your loop code on container via
CMD
inDockerfile
- For triggered webjob, you can try to use
crontab
with a schedule expression to trigger your code, please refer to the SO thread How to run a cron job inside a docker container? and the Unix SE thread https://unix.stackexchange.com/questions/429076/crontab-in-docker-container to know it. Otherwise, you also can try to integrate crontab-like libraries with programming languages you used to trigger your code, such asQuartz
orcron4j
for Java,schedule
(SO thread referenced How do I get a Cron like scheduler in Python?) orcrontab
for Python,node-cron
for Node.js, etc.
Hope it helps.

Peter Pan
- 23,476
- 4
- 25
- 43