AZ-400 Development Processes & Continuous Integration 5 — Questions and Answers
Question 1: A team wants to ensure every pull request to the main branch passes a CI build before it can be completed. Which Azure DevOps feature enforces this?
- Required reviewers policy
- Build validation branch policy (Correct answer)
- Commit message validation policy
- Work item linking policy
Correct answer: Build validation branch policy
Build validation branch policies require a specified pipeline to succeed before a pull request targeting that branch can be completed.
Question 2: You are designing a CI pipeline for a monorepo containing five microservices. You want to build only the services affected by a given commit. What approach achieves this?
- Always build all five services to ensure consistency
- Use path filters in the pipeline trigger to conditionally run service-specific jobs (Correct answer)
- Create one repository per microservice and link them
- Build services alphabetically and stop on the first failure
Correct answer: Use path filters in the pipeline trigger to conditionally run service-specific jobs
Path filters in Azure Pipelines triggers allow pipelines or specific jobs to run only when files within specified directories have changed.
Question 3: Which code coverage tool integration is natively supported by the Azure Pipelines 'PublishCodeCoverageResults' task?
- Only Istanbul/NYC for JavaScript
- Only JaCoCo for Java projects
- Cobertura and JaCoCo formats across multiple languages (Correct answer)
- Only .NET coverage via Visual Studio
Correct answer: Cobertura and JaCoCo formats across multiple languages
The PublishCodeCoverageResults task accepts Cobertura and JaCoCo format XML files, making it compatible with coverage tools across Java, .NET, Python, and JavaScript ecosystems.
Question 4: A developer introduces a change that causes 15% of existing unit tests to fail. What should the CI pipeline do by default?
- Continue to the next stage and flag the failures in the summary
- Fail the pipeline and prevent the build artifact from being published (Correct answer)
- Send an email to the developer and continue the build
- Mark the tests as skipped and publish the artifact
Correct answer: Fail the pipeline and prevent the build artifact from being published
By default, test task failures cause the pipeline job to fail, preventing artifact publication and blocking downstream stages that depend on the job.
Question 5: What is 'shift-left testing' in the context of a CI/CD pipeline?
- Moving deployment steps earlier in the pipeline
- Running security and quality checks earlier in the development lifecycle (Correct answer)
- Shifting code reviews to after deployment
- Prioritizing left-to-right execution order in YAML stages
Correct answer: Running security and quality checks earlier in the development lifecycle
Shift-left testing means running tests and quality checks as early as possible in the development process to catch defects before they propagate downstream.
Question 6: A pipeline YAML file references a template stored in a different repository. What must be defined to allow this cross-repository template reference?
- A service connection to that repository's hosting organization
- A 'resources.repositories' block declaring the external repository (Correct answer)
- A separate pipeline that clones the template repo first
- An environment variable containing the repository URL
Correct answer: A 'resources.repositories' block declaring the external repository
The 'resources.repositories' block in YAML declares external repositories that can then be referenced as template sources using the '@repoAlias' syntax.
Question 7: Which Azure DevOps capability allows you to view the historical trend of test pass rate and build duration over time?
- Pipeline analytics and reports accessible from the pipeline summary page (Correct answer)
- Azure Monitor workbooks configured manually
- The Deployment Frequency metric in Azure Boards
- Work item velocity charts in sprint planning
Correct answer: Pipeline analytics and reports accessible from the pipeline summary page
Azure Pipelines provides built-in analytics reports showing trends for test pass rate, pipeline duration, and failure rates directly within the pipeline UI.
A team wants to ensure every pull request to the main branch passes a CI build before it can be completed.
Which Azure DevOps feature enforces this?