AZ-400 exam dumps

AZ-400 practice question 106 of 306

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

AZ-400 Question 106

Single answer

Your team maintains a multi-stage Azure DevOps pipeline for a microservices application. Each build produces artifacts that need to be distinctly identifiable for troubleshooting and future deployments. You store a numeric version in a configuration file (version.json) and want the artifact� name to include both that semantic version (e.g., 2.1.3) and the build run ID. Which approach should you implement to ensure each artifact is properly versioned and traceable across pipeline runs?

  1. A

    A) Manually rename the artifact after each successful build to append the run ID to the version from version.json.

  2. B

    B) Configure a pipeline variable that parses version.json, updates the build number with semantic version plus build ID, and reference that build number when publishing the artifact.

  3. C

    C) Use a fixed artifact naming convention in the pipeline (for example, 'myapp.latest') and store the version only in the release notes.

  4. D

    D) Add an environment variable on the build agent to store the version and specify the build ID in a script task that uploads artifacts.

Show answer and explanation

Correct answer: B

Explanation

The recommended practice is to dynamically update the build number (or artifact name) using a pipeline variable that captures both the semantic version from a file such as version.json and a unique build ID. This ensures each artifact is traceable back to a specific pipeline run and version. See official Azure DevOps documentation on pipeline variables and build numbering (https://docs.microsoft.com/azure/devops/pipelines) for guidance on setting custom build numbers and artifact names.

  • A. Incorrect.

    Option A: Incorrect. Manually renaming artifacts can lead to inconsistency and errors, especially in automated CI/CD processes. This approach is not scalable.

  • B. Correct.

    Option B: Correct. By defining a pipeline variable that reads version.json, you can update the build identifier to include both the semantic version and the build run ID. Then, referencing that build number ensures the artifact is consistently named and traceable.

  • C. Incorrect.

    Option C: Incorrect. Using a fixed naming convention like 'myapp.latest' without version identifiers makes it difficult to trace which artifact came from which build or version.

  • D. Incorrect.

    Option D: Incorrect. Storing the version in an environment variable on the build agent and manually uploading artifacts is prone to human error and does not guarantee consistent versioning unless carefully orchestrated.

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