AZ-400 Question 207
Single answerYou are leading a DevOps initiative at an organization that uses Azure Pipelines to build and deploy a Node.js microservices solution. The builds run multiple times every day, and each run triggers a fresh installation of dependencies from npm, which significantly increases build time. You want to reduce build duration and optimize costs while maintaining reliable outcomes. Which approach should you recommend to improve performance and enhance reliability across the pipeline?
- A
Configure pipeline caching to store and reuse npm dependencies
- B
Increase the build agent� VM size to reduce the build time
- C
Disable tests on the build pipeline to speed up overall execution
- D
Run additional parallel jobs to reduce the total build duration
Show answer and explanation
Correct answer: A
Explanation
Caching frequently used dependencies is a recommended best practice in Azure Pipelines to optimize performance and cost. According to Microsoft� documentation, Azure Pipeline Caching can significantly reduce execution time and resource usage. Increasing VM size or parallel jobs may address speed but often leads to higher costs or diminished efficiency. Disabling tests to reduce build time risks reliability and quality.
- A. Correct.
Correct. By leveraging pipeline caching for your npm dependencies, you reduce the time spent repeatedly restoring packages. This speeds up the build, lowers pipeline execution costs, and keeps the reliability of the build process intact. Microsoft documentation recommends using built-in caching tasks for commonly used dependency managers.
- B. Incorrect.
Incorrect. Upgrading to a larger VM can indeed speed up builds, but it often increases costs significantly. It also may not resolve underlying inefficiencies in the process (like repeatedly installing dependencies).
- C. Incorrect.
Incorrect. While disabling tests can reduce build time, it compromises reliability. Tests are crucial for catching defects early and ensuring the solution meets quality standards.
- D. Incorrect.
Incorrect. Increasing parallel jobs can speed up the overall duration if multiple pipelines or stages are running, but it does not solve the repeated installation overhead for dependencies and can also lead to higher costs if not managed properly.