skip to Main Content

I am getting started with container apps in Azure and migrating to a container driven environment for our deployment.

Currently we have many programs in multiple languages (Java, Python, PHP, etc) which are executed on a recurring schedule. These recurring jobs will query external systems for orders, product inventory, and other information. They then pass this to a server which will also run in a container apps environment. There should be at max 1 instance of this application running.

However, I don’t see any scheduling functionality in Container Apps. Is this something that is better handled elsewhere in the Azure ecosystem?

3

Answers


  1. You can use

    1. Regular cron jobs on plain old VMs
    2. Cron jobs on kubernetes
    3. Run periodic jobs using your CI system such as gitlab or github actions

    AWS provides triggering lambdas at a periodic schedule – maybe azure has something similar

    Login or Signup to reply.
  2. One possible solution is to use azure function @Schedule that uses a cron format.

    by adapting your Java, Python, PHP, etc code to azure functions:

    see microsoft doc on @schedule

    and the function getting started

    sample from docs:

    @FunctionName("keepAlive")
    public void keepAlive(
      @TimerTrigger(name = "keepAliveTrigger", schedule = "0 */5 * * * *") String timerInfo,
          ExecutionContext context
     ) {
         // timeInfo is a JSON string, you can deserialize it to an object using your favorite JSON library
         context.getLogger().info("Timer is triggered: " + timerInfo);
    }
    
    Login or Signup to reply.
  3. You can use Dapr with ACA which supports Cron jobs and should satisfy your needs if you are willing to enable Dapr. I have a detailed post about it https://bitoftech.net/2022/09/05/azure-container-apps-with-dapr-bindings-building-block/

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search