AZ-400 Development Processes & Continuous Integration 3 — Questions and Answers
Question 1: Your Azure Pipeline YAML uses a self-hosted agent pool. The build fails with 'no agents available.' What is the most likely cause?
- The pipeline YAML syntax is invalid
- All agents in the pool are busy or offline (Correct answer)
- The service connection lacks contributor permissions
- The branch trigger pattern does not match the current branch
Correct answer: All agents in the pool are busy or offline
When no agents are available in a self-hosted pool, the pipeline queues until an agent comes online or becomes free.
Question 2: What does the 'checkout: self' step do in an Azure Pipelines YAML job?
- Checks out the repository that contains the pipeline YAML file (Correct answer)
- Checks out all repositories in the organization
- Switches to the main branch before building
- Clones only the most recent commit with no history
Correct answer: Checks out the repository that contains the pipeline YAML file
'checkout: self' clones the repository that contains the currently running pipeline YAML, which is the default behavior for most jobs.
Question 3: A team wants to prevent secrets from being printed in pipeline logs. Which Azure DevOps feature automatically masks secret values in log output?
- Pipeline variables marked as 'secret' (Correct answer)
- Secure files in the Library
- Service connection credentials
- Key Vault references with read-only scope
Correct answer: Pipeline variables marked as 'secret'
Variables marked as secret in Azure Pipelines are automatically masked in log output, preventing accidental exposure.
Question 4: Which branching strategy minimizes merge conflicts and supports continuous integration most effectively?
- Long-lived feature branches merged quarterly
- Trunk-based development with short-lived branches (Correct answer)
- Git Flow with release branches kept open indefinitely
- One branch per developer never merged to main
Correct answer: Trunk-based development with short-lived branches
Trunk-based development with short-lived branches keeps integration frequent and minimizes divergence, which is the foundation of effective CI.
Question 5: You want to publish test results from a pytest run so they appear in the Azure Pipelines test reporting UI. Which task should you use?
- PublishBuildArtifacts
- PublishTestResults (Correct answer)
- CopyFiles
- ArchiveFiles
Correct answer: PublishTestResults
The PublishTestResults task uploads JUnit, NUnit, or other format test result files so they are displayed in the pipeline's Tests tab.
Question 6: A CI pipeline takes 45 minutes to complete, causing slow feedback. Which optimization should be tried first?
- Remove all unit tests from the pipeline
- Parallelize test execution across multiple agents using matrix or parallel jobs (Correct answer)
- Switch from YAML to classic pipelines
- Increase agent VM size to maximum available
Correct answer: Parallelize test execution across multiple agents using matrix or parallel jobs
Parallelizing tests across agents is the most impactful optimization for long CI pipelines, reducing total time proportional to the number of parallel jobs.
Question 7: What is the function of the 'dependsOn' keyword in an Azure Pipelines YAML multi-stage pipeline?
- It lists required NuGet packages for the build
- It defines which stages or jobs must complete before the current one starts (Correct answer)
- It specifies which work items are linked to the pipeline run
- It controls which Azure subscription the pipeline deploys to
Correct answer: It defines which stages or jobs must complete before the current one starts
'dependsOn' establishes execution order between stages or jobs, ensuring prerequisites complete successfully before the dependent stage begins.
Your Azure Pipeline YAML uses a self-hosted agent pool.
The build fails with 'no agents available.' What is the most likely cause?