Resolving a Job Cancelled for Exceeding Maximum Agent Idle Time
You have a YAML pipeline that uses a self-hosted agent. The agent runs on a VM in Azure. The pipeline fails intermittently with the error: '##[error]The job running on agent MyAgent has been cancelled because the agent was idle for more than the maximum idle time.' You need to resolve this issue. What should you do?
Quick Answer
That specific error — a job cancelled for exceeding maximum agent idle time — points directly at the self-hosted agent's idle timeout setting being too aggressive for how the job actually runs. Raising or disabling that timeout in the agent's configuration is the fix; it stops the agent from getting cancelled mid-job during longer stretches of inactivity.
⚠ Common exam trap
Watch out — candidates often confuse the job-level timeout (pipeline job timeout) with the agent-level idle timeout, leading candidates to incorrectly choose option C instead of recognizing that the error specifically references agent idle time, not job execution duration.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Configure the agent's idle timeout setting to a higher value or disable it.
The error indicates that the self-hosted agent was idle for longer than the configured maximum idle time, causing Azure Pipelines to cancel the job. Option A is correct because increasing or disabling the idle timeout setting on the agent (via the agent's configuration file or environment variable) directly addresses this issue by allowing longer periods of inactivity before cancellation.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Configure the agent's idle timeout setting to a higher value or disable it.
Why this is correct
The idle timeout cancels the job if the agent is idle too long; increasing it prevents premature cancellation.
- ✗
Add more agents to the agent pool.
Why it's wrong here
Adding agents does not fix the idle timeout issue on the existing agent.
- ✗
Increase the job's timeout in minutes.
Why it's wrong here
Job timeout controls how long the job can run, not idle time.
- ✗
Reduce the number of parallel jobs to avoid overloading the agent.
Why it's wrong here
The error is about idle timeout, not resource overload.
Visual reference
Go deeper
Related to this question
Learn chapter
Introduction to DevOps and Azure DevOps
Key term
Environment
An environment is a dedicated set of computing resources, configurations, and services used to develop, test, or host software applications in a controlled and repeatable way.
Key term
Azure Pipelines
Azure Pipelines is a cloud-based CI/CD service from Microsoft that automatically builds, tests, and deploys code to any platform or cloud.
About these practice questions
This AZ-400 question is part of Courseiva's 823-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
Same concept, more angles
1 more way this is tested on AZ-400
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. Your build pipeline fails intermittently with the error: 'The job running on agent 'Azure Pipelines' exceeded the maximum execution time of 60 minutes.' How can you resolve this issue?
easy- ✓ A.Increase the 'timeoutInMinutes' property in the pipeline YAML for the job.
- B.Split the pipeline into multiple stages to reduce job duration.
- C.Enable parallel jobs to run the pipeline faster.
- D.Use a self-hosted agent with more CPU cores.
Why A: The error indicates the job exceeded the default 60-minute timeout for Azure Pipelines hosted agents. Increasing the 'timeoutInMinutes' property in the pipeline YAML for the job explicitly extends the maximum execution time, directly resolving the timeout issue. This property can be set at the job level to allow longer-running tasks without changing the pipeline structure.
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This AZ-400 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AZ-400 exam.