AZ-400 Practice Question: Design and implement build and release pipelines
You are designing a build pipeline for a Python application that uses Anaconda environments. The pipeline must create a Conda environment, install dependencies, and run tests. The pipeline should also cache the Conda environment to speed up subsequent builds. Which configuration should you use?
⚠ Common exam trap
Test-takers frequently assume manual scripting (Option D) is more flexible or that Docker (Option B) is always the best isolation strategy, but they overlook the purpose-built 'CondaEnvironment' task and its seamless integration with the 'Cache' task for efficient, maintainable pipelines.
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
✓
Use the 'CondaEnvironment' task to create the environment, and use the 'Cache' task to cache the Conda packages folder.
The 'CondaEnvironment' task is purpose-built for creating and updating Conda environments from an environment.yml file, and combining it with the 'Cache' task to cache the Conda packages folder (typically `$(Pipeline.Workspace)/conda_pkgs`) significantly reduces build time by avoiding re-downloading packages on subsequent runs. This approach aligns with Azure DevOps best practices for dependency caching and Conda environment management.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use the 'UsePythonVersion' task with a version spec, and add a script to create the Conda environment.
Why it's wrong here
The 'UsePythonVersion' task only selects or installs a Python interpreter version; it does not create or manage Conda environments. Running a script to create a Conda environment after this task is possible, but it does not leverage the purpose-built 'CondaEnvironment' task, making it an indirect and less robust approach.
- ✗
Use a Docker container with Anaconda pre-installed and run the pipeline inside the container.
Why it's wrong here
While a Docker container with Anaconda pre-installed can provide a consistent Python environment, it adds significant complexity to the pipeline. Caching is not straightforward because the Conda environment inside the container is not persisted across pipeline runs unless you implement custom volume mounts or cache logic, making it less efficient and more error-prone.
- ✓
Use the 'CondaEnvironment' task to create the environment, and use the 'Cache' task to cache the Conda packages folder.
Why this is correct
The 'CondaEnvironment' task is specifically designed to create a Conda environment from a YAML file or package specification, ensuring the environment is set up correctly and integrated with the pipeline. Pairing it with the 'Cache' task to cache the Conda packages folder (typically 'pkgs') reduces re-download overhead and speeds up subsequent runs.
- ✗
Use a script to run 'conda create' and 'conda install', and manually cache the environment by specifying a path.
Why it's wrong here
Using a script to run 'conda create' and 'conda install' manually, then caching a specified path, is a valid but less efficient approach than the dedicated 'CondaEnvironment' task. The manual method requires you to manage cache keys, restoration, and environment consistency yourself, whereas the dedicated task provides built-in integration and better maintainability.
Go deeper
Related to this question
Learn chapter
Introduction to DevOps and Azure DevOps
Key term
Pipeline
A pipeline is an automated series of steps that takes code from development to production, ensuring quality and speed.
Key term
Build pipeline
A build pipeline is an automated sequence of steps that compiles source code into a deployable artifact, running tests and checks along the way.
About these practice questions
One of 823 original AZ-400 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
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.