Behaviour of Scheduled Job (Cron) when a previous job is running and new one is triggered

RajivBansal-2486 331 Reputation points
2025-03-10T08:32:02.1433333+00:00

I have a job scheduled in container app jobs to execute after every 5 minutes.

Suppose a job is triggered at 11:00 a.m. Now before this finished another job is triggered at 11:05. What will happen to the previously running job. Will it get terminated or will both will run in parallel or will new job won't be scheduled. Please let me know how to control this behaviour.

Azure Container Apps
Azure Container Apps
An Azure service that provides a general-purpose, serverless container platform.
570 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Sai Prabhu Naveen Parimi 395 Reputation points Microsoft External Staff
    2025-03-10T09:41:39.6033333+00:00

    RajivBansal-2486

    When a new instance of your scheduled job is triggered while a previous one is still running, the outcome depends on your Azure Container Apps Job configuration.

    Default Behavior – Runs in Parallel

    By default, Azure Container Apps Jobs allow multiple instances to run simultaneously. So if your job starts at 11:00 AM and is still running when the next one is triggered at 11:05 AM, both will run in parallel unless limits are set.

    Preventing Overlapping Jobs (Controlling Concurrency)

    To ensure a new job doesn’t start before the previous one finishes, you have two options:

    • Set maxConcurrentJobs = 1
      • This ensures only one job runs at a time.
        • If a previous job is still running, the new one will be queued until it’s done.
        • Use a Singleton Job Type
          • With Azure Container Apps Jobs, configure the job type as "singleton" to ensure only one instance runs at any given time.

    For more details, check the official Microsoft documentation: https://learn.microsoft.com/en-us/azure/container-apps/jobs?tabs=azure-cli#scheduled-jobs

    Summary

    -->By default, jobs run in parallel.
    --> You can limit concurrency so only one job runs at a time.

    If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.


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.