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

Question 390

A library pipeline needs rapid feedback about pure business-logic functions before expensive deployments start. Which test level should run earliest?

  1. Collect failing test logs and artifacts
  2. Use ephemeral test environments for parallel pull requests
  3. Separate flaky tests from product regressions
  4. Run unit tests before packaging

Explanation

Correct Answer

D:

Unit tests exercise small components in isolation and are usually fast enough to provide immediate feedback during continuous integration.

Incorrect Answers

A:

Publishing diagnostic logs and test-result artifacts preserves failure evidence independently of the agent workspace lifecycle; low-cost component correctness cannot be inferred from durable failed-run diagnostics alone.

B:

Isolated short-lived test environments give each validation run independent dependencies and reduce cross-branch test contamination; the distinction is test dependency isolation per change versus low-cost component correctness.

C:

Identify and quarantine or stabilize nondeterministic tests while recording their outcomes, rather than hiding instability with unlimited retries; low-cost component correctness cannot be delivered through nondeterministic-test root cause management.

Question 391

The same test suite must run against four runtime versions, with results visible separately per version. Which job strategy minimizes copy-pasted YAML?

  1. Use maxParallel to cap matrix concurrency
  2. Use a matrix strategy for independent test variants
  3. Use deployment jobs for tracked environments
  4. Use job timeout settings for hung processes
  5. Use separate build and deployment stages

Explanation

Correct Answer

B:

A matrix strategy creates related job variants from configuration values, letting each variant run with its own parameters.

Incorrect Answers

A:

maxParallel limits concurrent matrix legs to an explicit maximum, balancing test speed with available agent capacity; it contributes to capped test-matrix fanout, with parameterized parallel test expansion still requiring its own control.

C:

Deployment jobs target environments and support deployment strategies, environment history, and resource-based approvals; this option addresses environment-aware deployment execution rather than addressing parameterized parallel test expansion.

D:

Job or task timeout settings place an upper limit on execution, allowing stalled runs to fail and free capacity; it handles stalled job resource protection but cannot by itself deliver parameterized parallel test expansion.

E:

Multi-stage YAML pipelines separate build and release phases with independent conditions, dependencies, and environment controls; parameterized parallel test expansion remains outside the responsibility of separation of build and delivery boundaries.

Question 392

An engineering lead needs a report of unresolved bugs that block user stories, including parent-child relationships. What query approach should be selected?

  1. Link test cases to user stories
  2. Link commits to Azure Boards work items
  3. Associate pipeline runs with commits
  4. Use Azure Boards queries with linked work items

Explanation

Correct Answer

D:

Work item link queries can evaluate relationships between bugs, stories, and other Azure Boards items rather than filtering only individual fields.

Incorrect Answers

A:

Azure Test Plans relationships between test cases and work items provide requirement-to-test coverage and execution context; here related-work-item reporting is the target, not requirement-to-test evidence.

B:

Referencing work-item IDs from commits and pull requests creates navigable development links in the work item and improves auditability; although that supports code-to-backlog traceability, this scenario calls for related-work-item reporting.

C:

Pipeline run metadata and immutable source commit identifiers connect produced artifacts to their source revision and build results; related-work-item reporting cannot be inferred from build-to-source provenance alone.

Question 393

An Azure Pipeline must run on pushes to main when service code changes, but must not run on docs-only changes or release-branch pushes. Which TWO trigger controls jointly implement this? Choose TWO.

  1. Configure a branch push trigger in Azure Pipelines
  2. Configure path-filtered CI triggers
  3. Configure a manual workflow_dispatch event
  4. Configure a scheduled pipeline trigger
  5. Configure pipeline-completion triggers

Explanation

Correct Answers

A:

A CI trigger with branch inclusion for main queues runs on matching pushes while excluding unrelated branches.

B:

YAML path include or exclude filters scope CI triggers to changes in specified repository paths; combine this path rule with a main-branch push trigger to avoid unrelated branches and documentation-only commits. Combine the path rule with a main-only branch trigger; neither restriction alone satisfies both exclusions.

Incorrect Answers

C:

workflow_dispatch supports manually started GitHub workflows and declared inputs, keeping emergency operations explicit; it contributes to operator-initiated parameterized workflow, with push-based mainline build selection still requiring its own control.

D:

Scheduled triggers use cron-style schedules to queue pipeline runs independently of repository push events; this solves time-driven unattended validation, leaving push-based mainline build selection unresolved.

E:

Pipeline resource completion triggers can queue downstream runs based on the completion of a specified upstream pipeline; this option addresses upstream-build-driven automation rather than addressing push-based mainline build selection.

Question 394

Developers can edit pipeline YAML and may bypass a deployment job environment reference, but any production Azure deployment requires the same service connection. Where should approval be enforced?

  1. Place approval checks on a production service connection
  2. Add an exclusive lock to serialize deployments
  3. Investigate a check that timed out
  4. Add a secure-file approval check
  5. Add an Invoke REST API check

Explanation

Correct Answer

A:

Approval checks attached to the protected service connection apply whenever an authorized pipeline attempts to use it, regardless of whether the YAML declares an environment.

Incorrect Answers

B:

The exclusive lock check serializes stage access to a protected resource, allowing one eligible deployment through at a time; mutual exclusion for release changes concerns a different control point than approval bound to cloud deployment credential.

C:

A stage does not run when required checks time out; the operator can inspect the check and retry the stage after correcting the condition; here approval bound to cloud deployment credential is the target, not missed check deadline diagnosis.

D:

A secure file can have an approval check that gates consumption even by an otherwise authorized pipeline; although that supports human review of signing-file use, this scenario calls for approval bound to cloud deployment credential.

E:

REST API checks integrate an external policy decision with the resource approval lifecycle before deployment begins; approval bound to cloud deployment credential cannot be inferred from external change-control API evaluation alone.

Question 395

A schema deployment completed without errors, but application queries may now be slower or failing in production. Which postdeployment validation is valuable?

  1. Monitor database error rates immediately after migration
  2. Make database migrations retry-safe
  3. Use a deployment lock around shared schema updates
  4. Use transactional migrations where supported
  5. Version database schema migrations with application code

Explanation

Correct Answer

A:

Query latency and database error telemetry can detect regressions that successful DDL execution alone cannot reveal.

Incorrect Answers

B:

Idempotent or state-aware migration execution detects already applied changes and prevents duplicate effects during retry; that changes safe partial migration rerun without delivering runtime postmigration database health.

C:

Serializing schema modification stages prevents concurrent migration attempts against the same shared database resource; exclusive database upgrade execution cannot substitute for runtime postmigration database health.

D:

Wrapping supported migration operations in a transaction allows atomic commit or rollback if a step fails; runtime postmigration database health falls outside the scope of all-or-nothing database change.

E:

Source-controlled migration scripts version database changes alongside application revisions and allow controlled execution in the release workflow; it contributes to versioned database evolution, with runtime postmigration database health still requiring its own control.

Question 396

PR-only security scans miss new advisories affecting unchanged code; what combined schedule should be implemented?

  1. Run CodeQL analysis inside a controlled container
  2. Run scanning on pull requests and scheduled baselines
  3. Enable GitHub Advanced Security for Azure DevOps
  4. Enable CodeQL code scanning for supported repositories

Explanation

Correct Answer

B:

Change-triggered and recurring scans together detect introduced vulnerabilities and subsequently disclosed issues in stable dependencies.

Incorrect Answers

A:

Running the supported CodeQL analysis workflow in a managed container isolates scanner tooling and makes its runtime dependencies repeatable across builds; it handles isolated static-analysis execution environment but cannot by itself deliver continuous risk detection beyond code changes.

C:

GitHub Advanced Security for Azure DevOps brings supported code, dependency, and secret scanning capabilities to Azure DevOps repositories; that acts on advanced scanning on Azure Repos, whereas the requested outcome is continuous risk detection beyond code changes.

D:

CodeQL analyzes code using language-aware queries and can surface findings through GitHub code scanning; static code vulnerability analysis concerns a different control point than continuous risk detection beyond code changes.

Question 397

Multiple teams need a consistent, versioned infrastructure module catalog instead of copying Bicep files between repos. Which distribution method helps?

  1. Use Bicep modules for reusable resource groups
  2. Use a reusable module registry for Bicep
  3. Detect environment drift with desired-state comparisons
  4. Use Azure Policy to check IaC outcomes
  5. Use managed identity for IaC execution

Explanation

Correct Answer

B:

A supported Bicep module registry publishes reusable modules with explicit version references for consuming templates.

Incorrect Answers

A:

Bicep modules package resource declarations behind parameters and outputs so common infrastructure patterns can be reused; the distinction is modular Azure resource definitions versus centrally versioned IaC component sharing.

C:

Drift checks compare actual deployed configuration with version-controlled intended state, revealing out-of-band changes; its effect is detecting manual configuration divergence, not centrally versioned IaC component sharing.

D:

Azure Policy evaluates configured resource compliance and can deny changes that violate assigned policy definitions; that changes enforcement of Azure resource guardrails without delivering centrally versioned IaC component sharing.

E:

Federated or managed workload identities enable Azure authentication without embedding reusable credential secrets in source or task configuration; credentialless deployment identity cannot substitute for centrally versioned IaC component sharing.

Question 398

A single service principal can deploy to every subscription, and a compromised dev pipeline could alter production. Which identity layout reduces blast radius?

  1. Rotate expiring application credentials before outage
  2. Prefer a certificate credential over an unmanaged shared password when required
  3. Assign only data-plane access for Key Vault secret retrieval
  4. Use managed identity when Azure hosting supports it
  5. Use workload identity federation for Azure Pipelines
  6. Separate production and development deployment identities

Explanation

Correct Answer

F:

Distinct workload identities and scoped RBAC separate lower-trust development automation from production deployment authority.

Incorrect Answers

A:

Credential expiry monitoring and planned rotation prevent authentication failures while maintaining auditability of replacement keys; this solves noninteractive identity credential continuity, leaving environment identity isolation unresolved.

B:

Certificate credentials support asymmetric authentication and rotation, avoiding broad reuse of a plaintext shared client secret; this option addresses certificate-backed application identity rather than addressing environment identity isolation.

C:

Key Vault data-plane roles or access policies grant secret retrieval without general resource management authority; it handles secret-read without infrastructure administration but cannot by itself deliver environment identity isolation.

D:

Managed identity obtains Azure access tokens from the hosting platform without a developer-managed long-lived authentication secret; environment identity isolation remains outside the responsibility of elimination of embedded Azure credentials.

E:

Workload identity federation exchanges trusted short-lived pipeline assertions for Azure access tokens without storing a client secret; that acts on secretless Azure DevOps-to-Azure authentication, whereas the requested outcome is environment identity isolation.

Question 399

A pipeline updates a variable during a preceding step, and a later task must read the new value immediately before execution. Which variable reference syntax should it use?

  1. Use secret pipeline variables for confidential values
  2. Use a variable group for shared environment settings
  3. Use runtime macro syntax for a task input
  4. Use dependsOn to order jobs
  5. Use template expressions for parameter-driven structure

Explanation

Correct Answer

C:

Azure Pipelines macro syntax such as $(name) is expanded at runtime before tasks execute and can reflect prior variable updates.

Incorrect Answers

A:

Secret variables store sensitive settings outside checked-in YAML and require controlled injection into task environments; although that supports runtime secret injection, this scenario calls for task-time variable value expansion.

B:

Variable groups centralize named variables for authorized pipelines, with optional secret integration and access controls; task-time variable value expansion cannot be inferred from shared pipeline configuration alone.

D:

A dependsOn relationship establishes an execution dependency between jobs or stages, enabling controlled ordering and status evaluation; task-time variable value expansion cannot be delivered through explicit job prerequisite ordering.

E:

Compile-time template expressions evaluate parameters and statically available variables while expanding reusable YAML structure; its effect is compile-time job graph generation, not task-time variable value expansion.

Question 400

Hundreds of low-priority findings exist, but the organization wants clear blocking conditions based on exploitability and severity. Which governance control should be codified?

  1. Define vulnerability severity thresholds for release decisions
  2. Use least-privilege tokens for security scanners
  3. Run scanning on pull requests and scheduled baselines
  4. Enable GitHub Advanced Security for Azure DevOps

Explanation

Correct Answer

A:

A documented risk-based scanning policy defines failure thresholds and exception handling rather than treating every scanner finding equally.

Incorrect Answers

B:

Grant only the API permissions necessary to retrieve code and publish assessment results, keeping repository administration separate; it contributes to narrow automation scanner identity, with policy-driven vulnerability release gate still requiring its own control.

C:

Change-triggered and recurring scans together detect introduced vulnerabilities and subsequently disclosed issues in stable dependencies; this solves continuous risk detection beyond code changes, leaving policy-driven vulnerability release gate unresolved.

D:

GitHub Advanced Security for Azure DevOps brings supported code, dependency, and secret scanning capabilities to Azure DevOps repositories; this option addresses advanced scanning on Azure Repos rather than addressing policy-driven vulnerability release gate.

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