Cron job in AppService? Or alternative?

Tristan Chambers 1 Reputation point
2021-06-16T12:28:45.853+00:00

Hi I need to run a periodic (nightly) background task for maintaining my system running in an Azure App Service -- Linux Python runtime. On a traditional VPS I would use cron for this task. Is cron the appropriate solution in the Azure App Service context? If not what would you recommend instead? If cron is appropriate is there anything I need to know in terms of the inherent impermanence of the system? I'm assuming that I would need to add the creation of the cron job to a custom deployment script, to ensure that it was in place any time the system was rebuilt.

Notes: I explored using WebJobs but, at the time of writing, the documentation says "WebJobs is not yet supported for App Service on Linux."
https://learn.microsoft.com/en-us/azure/app-service/webjobs-create

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,191 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,020 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Lex Li (Microsoft) 5,662 Reputation points Microsoft Employee
    2021-06-16T14:41:29.193+00:00

    Azure Functions is always there and you just need a Timer triggered function,

    https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-timer?tabs=python#example

    1 person found this answer helpful.

  2. Karan Bhatt 47 Reputation points
    2022-04-20T07:32:13.03+00:00

    @Tristan Chambers ,
    Hope you are good.

    I have found something that might help you to run Cron Job in Azure App service.

    You can use the "SSH Console" of the Linux based App service which is located under Development Tools.

    I have configure in that, and it is work proper as of now.

    Ref. Link: https://learn.microsoft.com/en-us/azure/app-service/configure-linux-open-ssh-session

    This service is might be in public preview currently but useful for configuring cron.

    Vote up if it found helpful.

    Regards,
    Karan


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.