“Webjobs” tab on WebApp for Containers is disabled

前端 未结 1 592
无人及你
无人及你 2021-01-23 03:24

I am trying to add a webjobs after creating and configuring a web app. But the webjobs tab is disbled

\"Snapshot

相关标签:
1条回答
  • 2021-01-23 04:03

    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.

    1. For continuous webjob, it just run webjob logic code in a loop. You only need to run your loop code on container via CMD in Dockerfile
    2. 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 as Quartz or cron4j for Java, schedule(SO thread referenced How do I get a Cron like scheduler in Python?) or crontab for Python, node-cron for Node.js, etc.

    Hope it helps.

    0 讨论(0)
提交回复
热议问题