Share via

Azure Webjob: Type Triggered, works with singleton principle or not?

Vikas Singh 20 Reputation points
2026-06-01T11:01:02.36+00:00

Hi, I am looking into the Azure webjobs, trigger type: Triggered. I have a webjob that run's every 5 mins. In the public documentation it is mentioned that by default they are singleton or running with single instance. There is not much detail about what singleton means here. For example: the webjob get's triggered (n+1)th time, while the nth run of the webjob is still running. Does this mean the (n+1)th run will not be executed as long as the nth run finishes? Or does it mean that both the run will be executed but then both the runs are using a different instance. This is a bit confusing, could you pls help with the understanding.

Azure App Service
Azure App Service

Azure App Service is a service used to create and deploy scalable, mission-critical web apps.


Answer accepted by question author

Praneeth Maddali 10,025 Reputation points Microsoft External Staff Moderator
2026-06-02T01:13:22.8866667+00:00

Hi @Vikas Singh

Thanks for reaching out with your question about Triggered Azure WebJobs and how the singleton behavior works.

Quick Explanation

By default, Triggered WebJobs (including scheduled ones) have is_singleton set to false. This means:

  • The job always runs on one App Service instance (Azure selects it automatically).
  • If a new trigger fires while the previous run is still executing, a second instance of the job can start in parallel on the same App Service instance.

If you want to prevent overlapping runs (i.e., ensure the next execution waits until the current one finishes), you can enable singleton mode.

Recommended Solution

Add or update a settings.job file in the root of your WebJob folder with the following content:

{
  "schedule": "0 */5 * * * *",
  "is_singleton": true
}


After adding this and redeploying the WebJob, runs will be serialized — the (n+1)th execution will wait for the nth one to complete.

This is usually the safer option for scheduled jobs to avoid race conditions or duplicate processing.

Reference :

https://learn.microsoft.com/en-us/azure/app-service/webjobs-execution?tabs=windowscode
User's image

https://learn.microsoft.com/en-us/azure/app-service/webjobs-create?tabs=windowscode

User's image

If the answer is helpful,  Please do click "Accept the answer” and Yes, this can be beneficial to other community members.

If you have any other questions, let me know in the "comments" and I would be happy to help you

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

1 additional answer

Sort by: Most helpful
  1. AI answer

    2026-06-01T11:01:15.3933333+00:00

    For Azure WebJobs, “singleton” has two distinct aspects: how many instances of the job run across scaled-out App Service instances, and how many concurrent runs of the same job instance are allowed.

    1. Default singleton behavior
      • For continuous WebJobs, is_singleton defaults to true, which means only one instance of that WebJob runs across all scaled-out App Service instances.
      • For triggered WebJobs, is_singleton defaults to false; they run on a single App Service instance by design, but multiple runs of the same job can overlap unless you explicitly enforce singleton behavior.
    2. Controlling singleton behavior with settings.job The settings.job file lets you control concurrency and behavior:
         {
           "is_singleton": true,
           "run_mode": "scheduled"  // or "on_demand" / "continuous" as needed
         }
      
      • is_singleton: true ensures only one instance of the job runs across all scaled-out instances.
      • For a triggered job that runs every 5 minutes, if is_singleton is true and a new trigger fires while a previous run is still executing:
        • The (n+1)th run will not start until the nth run has finished. The job is effectively serialized.
      • If is_singleton is false (the default for triggered jobs):
        • A new trigger can start another run in parallel with the existing one, on the same instance.
    3. Summary for the described scenario
      • Triggered WebJob, scheduled every 5 minutes:
        • With is_singleton: true: runs are non-overlapping; (n+1) waits for n to complete.
        • With is_singleton: false (default): runs can overlap; (n+1) may start even if n is still running, on the same instance.

    To guarantee that only one run is ever active at a time for a triggered WebJob, configure is_singleton: true in settings.job.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.