AZ-400 Practice Question: Design and implement build and release pipelines
Your team uses Azure Pipelines to build a .NET application. Recently, builds have been failing intermittently with NuGet restore errors. The pipeline uses a hosted agent. You need to ensure consistent package restoration. What should you do?
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 a self-hosted agent with persistent NuGet package caches.
Using a self-hosted agent with persistent NuGet package caches ensures that packages are not re-downloaded on each build, avoiding intermittent network failures. Option B would clear the cache and force re-download, worsening the issue. Option C is for Docker builds, not NuGet. Option D is unrelated to package restoration.
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 a self-hosted agent with persistent NuGet package caches.
Why this is correct
Using a self-hosted agent with persistent NuGet package caches keeps the global-packages folder and HTTP cache across pipeline runs, so restore operations reuse already-downloaded packages instead of hitting external feeds every time. This reduces dependency on feed availability and network reliability, making builds faster and less prone to transient outages.
- ✗
Clear the NuGet cache in the pipeline using 'dotnet nuget locals all --clear' before restore.
Why it's wrong here
Running 'dotnet nuget locals all --clear' before restore wipes the global-packages folder, HTTP cache, and temp cache, forcing a complete re-download of every package from the feed. This increases build time and reintroduces failure risk from network issues or feed throttling, which is the exact opposite of improving reliability.
- ✗
Enable multi-stage Docker builds for the application.
Why it's wrong here
Multi-stage Docker builds are an image optimization technique that uses intermediate base images and layer caching to reduce final image size and build time. However, NuGet restore happens on the build agent before or separate from Docker, so multi-stage builds have no bearing on package restore reliability or feed access.
- ✗
Configure the pipeline to use the Dapr sidecar for package management.
Why it's wrong here
The Dapr sidecar is a runtime component for building microservices that provides building blocks like service invocation, state management, and pub/sub messaging. It has no relationship to NuGet package management or restoring .NET dependencies, so assigning it to handle package management is fundamentally misapplied.
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
Self-hosted agent
A self-hosted agent is a software component that you install and manage on your own infrastructure to run automated tasks for a CI/CD or DevOps platform.
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.