Courseiva
Design and implement build and release pipelinesmediumMultiple ChoiceObjective-mapped

AZ-400 Container jobs Practice Question

Your organization uses Azure Pipelines and requires that all builds be run on Microsoft-hosted agents to reduce maintenance overhead. However, you need to ensure that the build agent has a specific version of Node.js installed that is not available on the standard Microsoft-hosted agents. What should you do?

⚠ Common exam trap

The trap is that candidates often assume container jobs are not compatible with Microsoft-hosted agents, but many Microsoft-hosted agents (e.g., ubuntu-latest) have Docker installed and can run container jobs. Additionally, some might think installing Node.js via script is not allowed, but it is a supported practice.

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 container job that runs a custom Docker image with the required Node.js version.

Azure Pipelines supports container jobs on Microsoft-hosted agents with Docker (e.g., ubuntu-latest, windows-2019 with Docker enabled). By using a custom Docker image that includes the required Node.js version, you can run builds in a container while still using a Microsoft-hosted agent. Option C is also correct because you can use a script task at the start of the pipeline to install the specific Node.js version dynamically; Microsoft-hosted agents allow runtime installation of software via scripts. Options B and D are incorrect: B would require a self-hosted agent, violating the Microsoft-hosted agent requirement; D is not practical and not a guaranteed solution.

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 container job that runs a custom Docker image with the required Node.js version.

    Why this is correct

    Container jobs are supported on Microsoft-hosted agents that have Docker capability (e.g., ubuntu-latest). Using a custom Docker image with the required Node.js version is a valid approach because the container runs on the agent and can be configured with any tools.

  • Deploy a self-hosted agent with the required Node.js version.

    Why it's wrong here

    Deploying a self-hosted agent would violate the requirement to use Microsoft-hosted agents to reduce maintenance overhead, so this option is not applicable.

  • Use a script task to install the specific Node.js version at the start of the pipeline.

    Why this is correct

    Using a script task at the start of the pipeline to install the specific Node.js version is a straightforward method that works on Microsoft-hosted agents, as they allow runtime installation.

  • Request Microsoft to add the Node.js version to their hosted agents.

    Why it's wrong here

    Requesting Microsoft to add the Node.js version is not practical and unlikely to be implemented in a timely manner; it is not a valid solution.

About these practice questions

This AZ-400 question is part of Courseiva's 823-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

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.