Microsoft AZ-400 (Designing and Implementing Microsoft DevOps Solutions) Practice Test 22

Question 210

A pipeline author attempts to insert a production credential using a compile-time expression in repository YAML. Which safer design should replace that?

  1. Create a jobs template for common verification jobs
  2. Avoid expanding secrets into compile-time templates
  3. Use task groups for legacy classic build tasks
  4. Use protected variable groups for secrets

Explanation

Correct Answer

B:

Runtime secret variables or Key Vault retrieval keep sensitive values out of source-controlled template expansion and minimize accidental disclosure.

Incorrect Answers

A:

A jobs template encapsulates job definitions so each caller obtains the same validated worker and task structure; that changes reusable complete job without delivering separating secrets from YAML compilation.

C:

Task groups wrap reusable task sequences for classic pipelines, distinct from YAML template composition; separating secrets from YAML compilation falls outside the scope of classic-pipeline task reuse.

D:

Variable groups can be authorized for specific pipelines and supplemented with approvals or checks where supported; it contributes to authorized shared-secret consumption, with separating secrets from YAML compilation still requiring its own control.

Question 211

A pipeline's total duration increased, and engineers need to know which stage contributes most of the delay. What should the analysis compare?

  1. Identify unreliable external service dependencies
  2. Track critical-path stage duration
  3. Measure queue time separately from execution time
  4. Monitor retry-induced flaky tests
  5. Set artifact retention by compliance category
  6. Use pipeline run diagnostics for task failures

Explanation

Correct Answer

B:

Stage and job duration trends reveal where elapsed execution time is concentrated and where optimization has leverage.

Incorrect Answers

A:

Failure categorization by task and external dependency distinguishes platform or network outages from code defects; stage-level throughput bottlenecks remains outside the responsibility of external dependency build failures.

C:

Queue delay measures waiting for eligible execution capacity before a job starts, distinct from run duration; agent capacity waiting delay concerns a different control point than stage-level throughput bottlenecks.

D:

Per-attempt test outcomes show instability hidden by final-pass status and support targeted flaky-test repair; here stage-level throughput bottlenecks is the target, not retry-masked test instability.

E:

Different retention requirements should be applied to short-lived build outputs and preserved release assets according to compliance needs; although that supports tiered artifact lifecycle, this scenario calls for stage-level throughput bottlenecks.

F:

Pipeline diagnostic logging provides additional task and agent details that help isolate initialization and command failures; stage-level throughput bottlenecks cannot be inferred from detailed failing task investigation alone.

Question 212

The CI stages should run for all branches, but the production stage must run only for mainline source. Where should the control be expressed?

  1. Use always() for essential cleanup
  2. Use template parameters rather than variable substitution for a job list
  3. Use a variable group for shared environment settings
  4. Use runtime macro syntax for a task input
  5. Use stage-level conditions for branch-specific release
  6. Use dependsOn to order jobs

Explanation

Correct Answer

E:

A stage condition can evaluate branch metadata alongside success state to prevent production deployment from nonapproved branches.

Incorrect Answers

A:

always() allows a cleanup step to execute despite prior failure or cancellation, helping preserve diagnostics and release resources; branch-gated production stage cannot be delivered through unconditional finalization despite failures.

B:

Template parameters can pass job or step lists into reusable YAML during plan compilation; runtime strings cannot safely synthesize arbitrary job graphs; its effect is compile-time list injection, not branch-gated production stage.

C:

Variable groups centralize named variables for authorized pipelines, with optional secret integration and access controls; that changes shared pipeline configuration without delivering branch-gated production stage.

D:

Azure Pipelines macro syntax such as $(name) is expanded at runtime before tasks execute and can reflect prior variable updates; task-time variable value expansion cannot substitute for branch-gated production stage.

F:

A dependsOn relationship establishes an execution dependency between jobs or stages, enabling controlled ordering and status evaluation; it contributes to explicit job prerequisite ordering, with branch-gated production stage still requiring its own control.

Question 213

A repository receives potentially unsafe jobs and engineers want runner disk state destroyed after each job rather than reused by another workflow. Which model helps?

  1. Use an agent pool for shared self-hosted capacity
  2. Use a dedicated pool for untrusted pull requests
  3. Use a Microsoft-hosted agent for standard builds
  4. Use ephemeral self-hosted runners

Explanation

Correct Answer

D:

Ephemeral self-hosted runners are registered for a single job lifecycle, reducing residual cross-job state risks.

Incorrect Answers

A:

Agent pools group self-hosted workers with controlled project permissions, enabling shared execution capacity; this option addresses centralized managed worker fleet rather than addressing one-job runner lifecycle.

B:

Segregating untrusted workloads onto tightly scoped ephemeral workers limits credential and network exposure to attacker-controlled build scripts; it handles hostile-source execution isolation but cannot by itself deliver one-job runner lifecycle.

C:

Microsoft-hosted agents provide managed ephemeral build environments with common tools, reducing self-hosted patching and cleanup work; one-job runner lifecycle remains outside the responsibility of low-maintenance disposable CI execution.

Question 214

An Azure-hosted app reads a vault at runtime, and engineers want to avoid embedding service principal certificates on disk. Which identity is preferred?

  1. Use secret rotation without rebuilding application binaries
  2. Rotate a compromised secret at the source
  3. Use Key Vault certificates for managed certificate lifecycle
  4. Use managed identity for Key Vault retrieval

Explanation

Correct Answer

D:

A managed identity lets supported Azure resources authenticate to Key Vault with Entra tokens and assigned data access.

Incorrect Answers

A:

External secret storage and supported runtime refresh or restart decouple credential lifecycle from application compilation; Azure-hosted secret access without local credentials cannot be inferred from independent credential update lifecycle alone.

B:

Revoking and replacing the disclosed credential removes its future utility even if historical exposure cannot be undone; the distinction is containment after secret disclosure versus Azure-hosted secret access without local credentials.

C:

Key Vault certificate objects manage certificate lifecycle and associated keys or secret representations under configured access policy; Azure-hosted secret access without local credentials cannot be delivered through managed application certificate storage.

Question 215

An Azure Repos project wants supported secret, dependency, and code scanning features integrated with its existing repository workflow. Which product should administrators evaluate?

  1. Enable GitHub Advanced Security for Azure DevOps
  2. Define vulnerability severity thresholds for release decisions
  3. Run CodeQL analysis inside a controlled container
  4. Connect Azure DevOps to Microsoft Defender for Cloud DevOps security

Explanation

Correct Answer

A:

GitHub Advanced Security for Azure DevOps brings supported code, dependency, and secret scanning capabilities to Azure DevOps repositories.

Incorrect Answers

B:

A documented risk-based scanning policy defines failure thresholds and exception handling rather than treating every scanner finding equally; this solves policy-driven vulnerability release gate, leaving advanced scanning on Azure Repos unresolved.

C:

Running the supported CodeQL analysis workflow in a managed container isolates scanner tooling and makes its runtime dependencies repeatable across builds; this option addresses isolated static-analysis execution environment rather than addressing advanced scanning on Azure Repos.

D:

Connecting supported Azure DevOps organizations to Defender for Cloud DevOps security brings repository posture and findings into a code-to-cloud governance view; it handles cloud-correlated Azure Repos security posture but cannot by itself deliver advanced scanning on Azure Repos.

Question 216

Multiple groups share a monorepo and want ownership and review routing by subdirectory without splitting the repository. Which file should be maintained?

  1. Use repository path-based ownership
  2. Track large binaries with Git LFS
  3. Add .gitignore for local build outputs
  4. Use sparse checkout in a large monorepo

Explanation

Correct Answer

A:

CODEOWNERS maps repository path patterns to responsible reviewers and aids targeted review governance. Map directory patterns to the appropriate teams so affected changes reach reviewers with contextual ownership.

Incorrect Answers

B:

Git Large File Storage replaces tracked large-file content with pointers in Git and stores binary objects in separate LFS storage; although that supports separating bulky assets from Git history, this scenario calls for ownership within one large repository.

C:

The .gitignore file lists untracked path patterns Git should ignore; previously tracked files need separate untracking; ownership within one large repository cannot be inferred from exclude machine-local generated files alone.

D:

Sparse checkout limits the working-tree paths populated for a clone while retaining repository history semantics; the distinction is selective local working tree population versus ownership within one large repository.

Question 217

Automated reports need to distinguish bugfix and feature work consistently in branch names, with human-readable issue references. What governance control helps?

  1. Use a fast-forward merge for already-linear history
  2. Squash commits when completing a pull request
  3. Rebase a local topic branch before opening a pull request
  4. Implement a branch naming convention

Explanation

Correct Answer

D:

A documented naming convention combined with repository checks creates predictable branch metadata for automation and review.

Incorrect Answers

A:

Fast-forward moves the target branch reference to an existing descendant commit when histories have not diverged; merge without synthetic commit cannot substitute for classifying branch purpose.

B:

Squash merging combines the pull request's commits into a single new commit on the target branch; classifying branch purpose falls outside the scope of one logical commit per reviewed feature.

C:

Rebase reapplies local commits onto a newer base, reducing merge commits while rewriting local commit identities; it contributes to linearization of unpublished work, with classifying branch purpose still requiring its own control.

Question 218

A cross-functional team only wants active work in its product area, excluding completed stories from other teams. Which configuration narrows the report?

  1. Use Azure Boards query clauses for state and area path
  2. Use a query-based Azure Boards chart
  3. Track mean time to detect
  4. Track flaky-test frequency

Explanation

Correct Answer

A:

Query filters on State and Area Path scope the returned work items to lifecycle status and ownership hierarchy.

Incorrect Answers

B:

Charts built from supported work item queries visualize live result groupings and can be added to Azure DevOps dashboards; dynamic priority distribution concerns a different control point than backlog scope and state filtering.

C:

Mean time to detect measures detection latency and indicates how effectively monitoring surfaces incidents after they begin; here backlog scope and state filtering is the target, not incident detection delay.

D:

Flaky-test metrics identify tests with inconsistent outcomes across comparable runs and help prioritize stabilization work; although that supports inconsistent test result frequency, this scenario calls for backlog scope and state filtering.

Question 219

A CLI tool supports three operating systems and two language versions, and maintainers want one declarative test job covering all combinations. Which configuration fits?

  1. Use a GitHub-hosted runner for disposable jobs
  2. Use a GitHub Actions matrix for platform testing
  3. Use runner labels to route jobs
  4. Use GitHub Actions job needs for execution order
  5. Use artifact attestations for release provenance

Explanation

Correct Answer

B:

A matrix strategy expands one job definition over selected platform and version dimensions without duplicating steps.

Incorrect Answers

A:

GitHub-hosted runners provide managed disposable execution environments with common tooling and no persistent team-managed agent; its effect is managed workflow job execution, not combinatorial GitHub runtime testing.

C:

Labels identify runner characteristics and the runs-on selector can target machines with required labels; capability-specific GitHub job scheduling cannot substitute for combinatorial GitHub runtime testing.

D:

The needs key creates explicit GitHub Actions job dependencies so downstream jobs wait for required predecessors; combinatorial GitHub runtime testing falls outside the scope of dependency-ordered GitHub workflow jobs.

E:

Artifact attestations associate verifiable provenance statements with build outputs, improving downstream verification of their origin; it contributes to verifiable GitHub-generated artifact provenance, with combinatorial GitHub runtime testing still requiring its own control.

Question 220

A team deploys only some resources from a template but expects unrelated resources in the resource group to remain untouched. Which default-style deployment behavior is safer?

  1. Use deployment scopes for governance
  2. Use incremental deployment deliberately
  3. Use Azure Policy to check IaC outcomes
  4. Use Bicep modules for reusable resource groups

Explanation

Correct Answer

B:

Incremental ARM deployments update declared resources without treating every omitted resource as a deletion request.

Incorrect Answers

A:

Bicep and ARM deployments support appropriate target scopes, with authorization and resources matched to management or subscription hierarchy; it handles nonresource-group IaC target but cannot by itself deliver preserving unmanaged resource-group contents.

C:

Azure Policy evaluates configured resource compliance and can deny changes that violate assigned policy definitions; that acts on enforcement of Azure resource guardrails, whereas the requested outcome is preserving unmanaged resource-group contents.

D:

Bicep modules package resource declarations behind parameters and outputs so common infrastructure patterns can be reused; modular Azure resource definitions concerns a different control point than preserving unmanaged resource-group contents.

Designing and Implementing Microsoft DevOps Solutions (AZ-400) Practice Tests