I am trying to add a webjobs after creating and configuring a web app. But the webjobs tab is disbled
Asked
Active
Viewed 2,371 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
CMDinDockerfile - For triggered webjob, you can try to use
crontabwith 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 asQuartzorcron4jfor Java,schedule(SO thread referenced How do I get a Cron like scheduler in Python?) orcrontabfor Python,node-cronfor Node.js, etc.
Hope it helps.
Peter Pan
- 22,121
- 4
- 21
- 39