Skip to main content

Jobs

A job runs containerized work to completion. Choose a job when a workload needs to start, do a bounded amount of work, report success or failure, and stop.

Container apps are for continuously available services. Jobs are for finite work such as scheduled maintenance, batch processing, manual operations, or event-triggered tasks.

caution

Jobs do not have revisions. Revision-based rollout, labels, and traffic splitting are app concepts. A job definition describes the default configuration for future executions, and each execution is one run of that job.

At a glance​

Job conceptWhat it means
Workload typeRun-to-completion work with a clear start and end.
Runtime unitJob executions made up of one or more replicas.
Start optionsManual start, cron schedule, or event scale rule.
UpdatesJob definition changes affect future executions.
Good forBatch, maintenance, one-off, scheduled, or event-triggered tasks.

What is a job?​

A Container Apps job is a resource for run-to-completion work. The job definition stores the container template and default execution settings. When the job starts, Azure Container Apps creates a job execution. The execution runs one or more replicas until the configured completion behavior is reached or the execution fails.

Jobs and apps share the Container Apps environment, including networking and logging. Their lifecycle sets them apart. An app remains available as a service, while a job execution ends.

For setup details and command examples, see Jobs in Azure Container Apps.

Jobs vs. apps​

ConceptAppJob
Workload typeLong-running serviceRun-to-completion task
Runtime unitRevision replicasJob execution replicas
Start modelService demand or configured scaleManual start, schedule, or event
UpdatesRevision-scoped template changesJob definition changes for future executions
Good forWeb apps, APIs, microservices, continuous workersBatch, maintenance, one-off, scheduled, or event-triggered tasks

Use an app when something should keep accepting requests or continuously process work. Use a job when the work has a clear beginning and end.

The job mental model​

PartRole in the job model
Job definitionReusable configuration for future executions.
Job executionOne run of the job.
Job replicaA running instance of the job template inside an execution. It can include one or more containers.

Job definition​

The job definition stores reusable configuration. It includes the container template, trigger type, execution behavior, scale settings for event jobs, secrets, registries, identity, and related settings.

note

Changing the definition changes how later executions are created. It does not create an app-style revision.

Job execution​

A job execution is one run of the job. Manual jobs create executions when you start them. Scheduled jobs create executions from a cron schedule. Event jobs create executions when their scale rules detect work.

A job execution runs until it completes or fails. It can use settings such as replica completion count, parallelism, replica retry limit, and replica timeout.

Execution settingWhat it controls
Replica completion countDefines how many successful replica completions are required.
ParallelismControls how many replicas can run at the same time.
Replica retry limitSets the maximum number of times a replica can be retried.
Replica timeoutSets the maximum number of seconds a replica can run before it's stopped.

Job replica​

A job replica is a running instance of the job template inside an execution. It can include one or more containers. A single execution can run one replica or multiple replicas, depending on the job's replica completion count and parallelism settings.

Use replicas when the work can be split across concurrent workers in the same execution.

How jobs start​

A job uses one of three trigger types.

Trigger typeUse it when...How executions are created
ManualAnother person, tool, or automation system should decide when the work starts.You start the job.
ScheduleThe work should start on a recurring cron schedule.The cron expression creates executions.
EventExternal work should create executions.Scale settings and scale rules watch for work and start executions.

Manual​

Use a manual job when another person, tool, or automation system should decide when the work starts. A manual job can represent a maintenance task, a backfill, or a one-off processing run.

Manual jobs use replica completion count and parallelism settings to determine how many replicas must finish and how many can run at the same time.

Schedule​

Use a scheduled job when the work should start on a recurring cron schedule. Scheduled jobs also use replica completion count and parallelism settings, with a cron expression added to define when executions are created.

tip

For cron syntax and examples, see Jobs in Azure Container Apps.

Event​

Use an event job when external work should create executions. Event jobs use scale settings and scale rules to watch for work and start executions.

For event-driven setup details and KEDA scale-rule examples, see Tutorial: Deploy an event-driven job with Azure Container Apps.

When to choose a job​

Choose a job when:

  • The workload has a clear end condition.
  • You want each run to be tracked as an execution, with history retained for a limited number of recent executions.
  • Work should start manually, on a schedule, or in response to events.
  • Replicas can complete independently or in parallel.
  • You do not need HTTP traffic management, revision labels, or traffic splitting.
info

Choose a container app instead when the workload must be available continuously or needs app revision behavior. For the app model, see Container apps.