Home > Software design >  Scheduling Execution of Batch Jobs in Container Apps Enviornment
Scheduling Execution of Batch Jobs in Container Apps Enviornment

Time:08-11

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?

CodePudding user response:

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

CodePudding user response:

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);
}
  • Related