Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
jobs:
- job: string # Required as first property. ID of the job.
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 | [ variable ] # Job-specific variables.
strategy: strategy # Execution strategy for this job.
pool: string | pool # Pool where this job will run.
container: string | container # Container resource name.
services: # Container resources to run as a service container.
string: string # Name/value pairs
workspace: # Workspace options on the agent.
clean: outputs | resources | all # What to clean up before the job runs.
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 | reviewApp ] # A list of steps to run.
templateContext: # Job related information passed from a pipeline when extending a template.
jobs:
- job: string # Required as first property. ID of the job.
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 | [ variable ] # Job-specific variables.
strategy: strategy # Execution strategy for this job.
pool: string | pool # Pool where this job will run.
container: string | container # Container resource name.
services: # Container resources to run as a service container.
string: string # Name/value pairs
workspace: # Workspace options on the agent.
clean: outputs | resources | all # What to clean up before the job runs.
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 | reviewApp ] # A list of steps to run.
jobs:
- job: string # Required as first property. ID of the job.
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 | [ variable ] # Job-specific variables.
strategy: strategy # Execution strategy for this job.
pool: string | pool # Pool where this job will run.
container: string | container # Container resource name.
services: # Container resources to run as a service container.
string: string # Name/value pairs
workspace: # Workspace options on the agent.
clean: outputs | resources | all # What to clean up before the job runs.
steps: [ task | script | powershell | pwsh | bash | checkout | download | downloadBuild | getPackage | publish | template | reviewApp ] # A list of steps to run.
Definitions that reference this definition: jobs
Properties
job string. Required as first property.
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 | string list.
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 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 dictionary.
Container resources to run as a service container.
workspace workspace.
Workspace options on the agent. For more information about workspaces, including clean options, see the workspace topic in Jobs.
uses jobs.job.uses.
Specifies resources required by this job that are not already referenced elsewhere in the pipeline, for example by a checkout step or a repository resource. For more information about uses, see Limit job authorization scope and "uses" statement for pre-declaring resources.
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. For more information about templateContext, see Extended YAML Pipelines templates can now be passed context information for stages, jobs, and deployments and Templates - Use templateContext to pass properties to templates.
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.
For more information about templateContext, see Extended YAML Pipelines templates can now be passed context information for stages, jobs, and deployments and Templates - Use templateContext to pass properties to templates.
Examples
jobs:
- job: MyJob
displayName: My First Job
continueOnError: true
workspace:
clean: outputs
steps:
- script: echo My first job
See also
- For more information about
uses, see Limit job authorization scope to referenced Azure DevOps repositories. - For more information about workspaces, including clean options, see the workspace topic in Jobs.
- Learn more about variables, steps, pools, and server jobs.