azure-webjobsazure-webjobssdkazure-webjobs-triggered

Do Azure WebJobs run concurrently on the same host


If I have two distinct WebJobs, both triggered with TimerTrigger and at the same moment in time, can they ever run concurrently on the same host or will one wait for the other to complete?

In other words can a single host run two distinct webjobs in parallel which are triggered via TimerTrigger?

The main reason I am asking is because this project is heavily using both entity framework (DbContext) and also dependency injection and I want to be informed when planning my DI strategy. The solution for me may be challenging if two TimerTrigger webjobs can run concurrently on the same host (because services in this project receive an injected DbContext expecting a unit-of-work lifetime). In this case I might have to synchronize execution of the webjobs (within the same host) myself...


Solution

  • Yes, you can have many webjobs running at the time time. As long as they aren't configured to trigger based on a queue based trigger where an incoming message might cause conflict. You should be fine with a TimerTrigger.