AZ-400 exam dumps

AZ-400 practice question 201 of 306

Designing and Implementing Microsoft DevOps Solutions. Professional level, Microsoft. Free question with the correct answer and a full explanation.

AZ-400 Question 201

Select 2

Your organization is experiencing intermittent failures in several Azure DevOps pipelines due to environment inconsistencies and outdated pipeline definitions. You have been tasked with maintaining these build and release pipelines to ensure reliability and reduce downtime. Which two actions should you implement to improve pipeline maintainability and minimize failures?

  1. A

    Store pipeline definitions in version control (e.g., YAML) and reference them from your repository

  2. B

    Use ephemeral build agents or containers to ensure a clean environment for each pipeline run

  3. C

    Hardcode environment variables in the script to avoid external file dependencies

  4. D

    Configure personal access tokens (PATs) with indefinite expiration to eliminate frequent renewals

Show answer and explanation

Correct answers: A, B

Explanation

Maintaining a reliable and secure pipeline includes adopting methods that ensure consistent builds and secure credentials management. According to Microsoft� recommended DevOps practices, version-controlling pipeline definitions (via YAML) promotes better collaboration and rollback capabilities. Similarly, employing ephemeral build agents avoids persistent environment state issues, which are a common source of pipeline failures. References: Microsoft Docs on YAML pipelines (https://docs.microsoft.com/azure/devops/pipelines/yaml-pipeline-design) and agent management best practices (https://docs.microsoft.com/azure/devops/pipelines/agents/hosted).

  • A. Correct.

    Storing your pipeline definitions in version control as YAML helps maintain a history of changes and makes rolling back to a previous known-good configuration simpler. This approach also aligns with best practices for Infrastructure as Code (IaC).

  • B. Correct.

    Using ephemeral build agents (or containers) ensures that each pipeline run starts with a predictable and pristine environment, minimizing the likelihood of inconsistencies and environment drift.

  • C. Incorrect.

    Hardcoding environment variables within the pipeline script reduces flexibility and maintainability. Changes in one environment would force updates to the script itself, risking errors and breaking best practices.

  • D. Incorrect.

    Configuring long-lived or indefinite PATs is a security risk and falls short of Microsoft� best practices. Tokens should be renewed periodically to reduce the attack vector and ensure compliance with organizational security policies.

Timed practice exam

Take a AZ-400 practice test under exam conditions

70 questions in 90 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam