jobs.job definition

A job is a collection of steps run by an agent or on a server.

jobs:
- job: string # Required as first property. ID of the job. Valid names may only contain alphanumeric characters and '_' and may not start with a number.
  displayName: string # Human-readable name for the job. 
  dependsOn: string | [ string ]  # Any jobs which must complete before this one
  condition: string # Evaluate this condition expression to determine whether to run this job. 
  continueOnError: string # Continue running even on failure?. 
  timeoutInMinutes: string # Time to wait for this job to complete before the server kills it. 
  cancelTimeoutInMinutes: string # Time to wait for the job to cancel before forcibly terminating it. 
  variables: variables # Job-specific variables
  strategy: jobStrategy # Execution strategy for this job
  pool: pool # Pool where this job will run
  services:  # Container resources to run as a service container.
    string: string # Name/value pairs.
  workspace:  # Workspace options on the agent.
    clean: string # Scorch the repo before fetching?.  (outputs, resources, all)
  steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | publish | template | restoreCache | saveCache ]

Properties that use this definition: jobs

Properties

job

string

Required as first parameter. ID of the job. Acceptable values: Valid names may only contain alphanumeric characters and '_' and may not start with a number.

displayName

string

Human-readable name for the job.

dependsOn

string or string list

Any jobs which must complete before this one.

condition

string

Evaluate this condition expression to determine whether to run this job.

continueOnError

boolean

Continue running even on failure?

timeoutInMinutes

string

Time to wait for this job to complete before the server kills it.

cancelTimeoutInMinutes

string

Time to wait for the job to cancel before forcibly terminating it.

variables

variables

Job-specific variables.

strategy

jobs.job.strategy

Execution strategy for this job.

pool

pool

Pool where this job will run.

services

string name/value pairs

Container resources to run as a service container.

workspace

workspace options

Workspace options on the agent.

steps

steps

A list of steps to run.

jobs:
- job: string # Required as first property. ID of the job. Valid names may only contain alphanumeric characters and '_' and may not start with a number.
  displayName: string # Human-readable name for the job. 
  dependsOn: string | [ string ]  # Any jobs which must complete before this one
  condition: string # Evaluate this condition expression to determine whether to run this job. 
  continueOnError: string # Continue running even on failure?. 
  timeoutInMinutes: string # Time to wait for this job to complete before the server kills it. 
  cancelTimeoutInMinutes: string # Time to wait for the job to cancel before forcibly terminating it. 
  variables: variables # Job-specific variables
  strategy: jobStrategy # Execution strategy for this job
  pool: pool # Pool where this job will run
  container: jobContainer # Container resource name
  services:  # Container resources to run as a service container.
    string: string # Name/value pairs.
  workspace:  # Workspace options on the agent.
    clean: string # Scorch the repo before fetching?.  (outputs, resources, all)
  steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | publish | template | restoreCache | saveCache ]

Properties that use this definition: jobs

Properties

job

string

Required as first parameter. ID of the job. Acceptable values: Valid names may only contain alphanumeric characters and '_' and may not start with a number.

displayName

string

Human-readable name for the job.

dependsOn

string or string list

Any jobs which must complete before this one.

condition

string

Evaluate this condition expression to determine whether to run this job.

continueOnError

boolean

Continue running even on failure?

timeoutInMinutes

string

Time to wait for this job to complete before the server kills it.

cancelTimeoutInMinutes

string

Time to wait for the job to cancel before forcibly terminating it.

variables

variables

Job-specific variables.

strategy

jobs.job.strategy

Execution strategy for this job.

pool

pool

Pool where this job will run.

container

jobs.job.container

Container resource name.

services

string name/value pairs

Container resources to run as a service container.

workspace

workspace options

Workspace options on the agent.

steps

steps

A list of steps to run.

jobs:
- job: string # Required as first property. ID of the job. Valid names may only contain alphanumeric characters and '_' and may not start with a number.
  displayName: string # Human-readable name for the job. 
  dependsOn: string | [ string ]  # Any jobs which must complete before this one
  condition: string # Evaluate this condition expression to determine whether to run this job. 
  continueOnError: string # Continue running even on failure?. 
  timeoutInMinutes: string # Time to wait for this job to complete before the server kills it. 
  cancelTimeoutInMinutes: string # Time to wait for the job to cancel before forcibly terminating it. 
  variables: variables # Job-specific variables
  strategy: jobStrategy # Execution strategy for this job
  pool: pool # Pool where this job will run
  container: jobContainer # Container resource name
  services:  # Container resources to run as a service container.
    string: string # Name/value pairs.
  workspace:  # Workspace options on the agent.
    clean: string # Which parts of the workspace should be scorched before fetching.  (outputs, resources, all)
  steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | restoreCache | saveCache | reviewApp ]

Properties that use this definition: jobs

Properties

job

string

Required as first parameter. ID of the job. Acceptable values: Valid names may only contain alphanumeric characters and '_' and may not start with a number.

displayName

string

Human-readable name for the job.

dependsOn

string or string list

Any jobs which must complete before this one.

condition

string

Evaluate this condition expression to determine whether to run this job.

continueOnError

boolean

Continue running even on failure?

timeoutInMinutes

string

Time to wait for this job to complete before the server kills it.

cancelTimeoutInMinutes

string

Time to wait for the job to cancel before forcibly terminating it.

variables

variables

Job-specific variables.

strategy

jobs.job.strategy

Execution strategy for this job.

pool

pool

Pool where this job will run.

container

jobs.job.container

Container resource name.

services

string name/value pairs

Container resources to run as a service container.

workspace

workspace options

Workspace options on the agent.

steps

steps

A list of steps to run.

jobs:
- job: string # Required as first property. ID of the job. Valid names may only contain alphanumeric characters and '_' and may not start with a number.
  displayName: string # Human-readable name for the job. 
  dependsOn: string | [ string ]  # Any jobs which must complete before this one
  condition: string # Evaluate this condition expression to determine whether to run this job. 
  continueOnError: string # Continue running even on failure?. 
  timeoutInMinutes: string # Time to wait for this job to complete before the server kills it. 
  cancelTimeoutInMinutes: string # Time to wait for the job to cancel before forcibly terminating it. 
  variables: variables # Job-specific variables
  strategy: jobStrategy # Execution strategy for this job
  pool: pool # Pool where this job will run
  container: jobContainer # Container resource name
  services:  # Container resources to run as a service container.
    string: string # Name/value pairs.
  workspace:  # Workspace options on the agent.
    clean: string # Which parts of the workspace should be scorched before fetching.  (outputs, resources, all)
  uses:  # Any resources required by this job that are not already referenced
    repositories: [ string ] # Repository references 
    pools: [ string ] # Pool references 
  steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | restoreCache | saveCache | reviewApp ]

Properties that use this definition: jobs

Properties

job

string

Required as first parameter. ID of the job. Acceptable values: Valid names may only contain alphanumeric characters and '_' and may not start with a number.

displayName

string

Human-readable name for the job.

dependsOn

string or string list

Any jobs which must complete before this one.

condition

string

Evaluate this condition expression to determine whether to run this job.

continueOnError

boolean

Continue running even on failure?

timeoutInMinutes

string

Time to wait for this job to complete before the server kills it.

cancelTimeoutInMinutes

string

Time to wait for the job to cancel before forcibly terminating it.

variables

variables

Job-specific variables.

strategy

jobs.job.strategy

Execution strategy for this job.

pool

pool

Pool where this job will run.

container

jobs.job.container

Container resource name.

services

string name/value pairs

Container resources to run as a service container.

workspace

workspace options

Workspace options on the agent.

uses

pools and repositories

Any resources required by this job that are not already referenced.

steps

steps

A list of steps to run.

jobs:
- job: string # Required as first property. ID of the job. Valid names may only contain alphanumeric characters and '_' and may not start with a number.
  displayName: string # Human-readable name for the job. 
  dependsOn: string | [ string ]  # Any jobs which must complete before this one
  condition: string # Evaluate this condition expression to determine whether to run this job. 
  continueOnError: string # Continue running even on failure?. 
  timeoutInMinutes: string # Time to wait for this job to complete before the server kills it. 
  cancelTimeoutInMinutes: string # Time to wait for the job to cancel before forcibly terminating it. 
  variables: variables # Job-specific variables
  strategy: jobStrategy # Execution strategy for this job
  pool: pool # Pool where this job will run
  container: jobContainer # Container resource name
  services:  # Container resources to run as a service container.
    string: string # Name/value pairs.
  workspace:  # Workspace options on the agent.
    clean: string # Which parts of the workspace should be scorched before fetching.  (outputs, resources, all)
  uses:  # Any resources required by this job that are not already referenced
    repositories: [ string ] # Repository references 
    pools: [ string ] # Pool references 
  steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | restoreCache | saveCache | reviewApp ]
  templateContext:  # Job related information passed from a pipeline when extending a template. See remarks for more information.

Properties that use this definition: jobs

Properties

job

string

Required as first parameter. ID of the job. Acceptable values: Valid names may only contain alphanumeric characters and '_' and may not start with a number.

displayName

string

Human-readable name for the job.

dependsOn

string or string list

Any jobs which must complete before this one.

condition

string

Evaluate this condition expression to determine whether to run this job.

continueOnError

boolean

Continue running even on failure?

timeoutInMinutes

string

Time to wait for this job to complete before the server kills it.

cancelTimeoutInMinutes

string

Time to wait for the job to cancel before forcibly terminating it.

variables

variables

Job-specific variables.

strategy

jobs.job.strategy

Execution strategy for this job.

pool

pool

Pool where this job will run.

container

jobs.job.container

Container resource name.

services

string name/value pairs

Container resources to run as a service container.

workspace

workspace options

Workspace options on the agent.

uses

pools and repositories

Any resources required by this job that are not already referenced.

steps

steps

A list of steps to run.

templateContext

templateContext

Job related information passed from a pipeline when extending a template. See remarks for more information.

jobs:
- job: string # Required as first property. ID of the job. Valid names may only contain alphanumeric characters and '_' and may not start with a number.
  displayName: string # Human-readable name for the job. 
  dependsOn: string | [ string ]  # Any jobs which must complete before this one
  condition: string # Evaluate this condition expression to determine whether to run this job. 
  continueOnError: string # Continue running even on failure?. 
  timeoutInMinutes: string # Time to wait for this job to complete before the server kills it. 
  cancelTimeoutInMinutes: string # Time to wait for the job to cancel before forcibly terminating it. 
  variables: variables # Job-specific variables
  strategy: jobStrategy # Execution strategy for this job
  pool: pool # Pool where this job will run
  container: jobContainer # Container resource name
  services:  # Container resources to run as a service container.
    string: string # Name/value pairs.
  workspace:  # Workspace options on the agent.
    clean: string # Which parts of the workspace should be scorched before fetching.  (outputs, resources, all)
  uses:  # Any resources required by this job that are not already referenced
    repositories: [ string ] # Repository references 
    pools: [ string ] # Pool references 
  steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | restoreCache | saveCache | reviewApp ]
  templateContext:  # Job related information passed from a pipeline when extending a template. See remarks for more information.

Properties that use this definition: jobs

Properties

job

string

Required as first parameter. ID of the job. Acceptable values: Valid names may only contain alphanumeric characters and '_' and may not start with a number.

displayName

string

Human-readable name for the job.

dependsOn

string or string list

Any jobs which must complete before this one.

condition

string

Evaluate this condition expression to determine whether to run this job.

continueOnError

boolean

Continue running even on failure?

timeoutInMinutes

string

Time to wait for this job to complete before the server kills it.

cancelTimeoutInMinutes

string

Time to wait for the job to cancel before forcibly terminating it.

variables

variables

Job-specific variables.

strategy

jobs.job.strategy

Execution strategy for this job.

pool

pool

Pool where this job will run.

container

jobs.job.container

Container resource name.

services

string name/value pairs

Container resources to run as a service container.

workspace

workspace options

Workspace options on the agent.

uses

pools and repositories

Any resources required by this job that are not already referenced.

steps

steps

A list of steps to run.

templateContext

templateContext

Job related information passed from a pipeline when extending a template. See remarks for more information.

Remarks

The default timeoutInMinutes is set to 60 minutes. For more information, see Timeouts.

Jobs can run conditionally and might depend on earlier jobs.

Note

If you have only one stage and one job, you can use single-job syntax as a shorter way to describe the steps to run.

Examples

jobs:
- job: MyJob
  displayName: My First Job
  continueOnError: true
  workspace:
    clean: outputs
  steps:
  - script: echo My first job

See also