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

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.

Question 221

A repository wants pull requests that drop line coverage below an agreed floor to fail rather than merely display an informational report. What policy is needed?

  1. Require static-analysis pass before releasing
  2. Run a dependency vulnerability scan in CI
  3. Keep test reports when a later stage fails
  4. Fail the build on a defined coverage threshold

Explanation

Correct Answer

D:

A coverage-checking script or quality gate evaluates the computed metric against a threshold and returns a failing status when unmet.

Incorrect Answers

A:

A quality gate consumes analysis findings and prevents promotion when defined severity or policy conditions are violated; the distinction is static quality threshold enforcement versus enforced minimum tested-code percentage.

B:

Software composition analysis compares dependency identities and versions with known vulnerability data during the build; enforced minimum tested-code percentage cannot be delivered through third-party package risk detection.

C:

Publish test and coverage artifacts during the verification stage so later stage failures do not erase already collected evidence; its effect is independent validation evidence retention, not enforced minimum tested-code percentage.

Question 222

A schema update contains multiple statements that must either all succeed or leave no partial change, and the database supports transactional DDL for them. Which execution property helps?

  1. Use transactional migrations where supported
  2. Use backward-compatible stored procedure changes
  3. Version database schema migrations with application code
  4. Validate schema changes on a production-like dataset
  5. Prevent secret exposure in migration logs

Explanation

Correct Answer

A:

Wrapping supported migration operations in a transaction allows atomic commit or rollback if a step fails. Confirm the specific database operations are transaction-safe, because some schema alterations cannot roll back on every engine.

Incorrect Answers

B:

Compatible procedure interfaces or parallel versions allow old and new clients to operate during the transition; this option addresses stable database API for multiple versions rather than addressing all-or-nothing database change.

C:

Source-controlled migration scripts version database changes alongside application revisions and allow controlled execution in the release workflow; it handles versioned database evolution but cannot by itself deliver all-or-nothing database change.

D:

Rehearsing migrations on realistic data volumes exposes locking, performance, and compatibility problems absent from trivial test fixtures; all-or-nothing database change remains outside the responsibility of representative migration execution.

E:

Protected secret injection and logging controls avoid writing database credentials to console output or retained artifacts; that acts on migration credential confidentiality, whereas the requested outcome is all-or-nothing database change.

Question 223

A new package version introduces a known high-severity vulnerability even though code compiles successfully. Which test-related control should run?

  1. Use Azure Monitor alert evaluation as a release check
  2. Publish code coverage results in Azure Pipelines
  3. Run a dependency vulnerability scan in CI
  4. Fail the build on a defined coverage threshold

Explanation

Correct Answer

C:

Software composition analysis compares dependency identities and versions with known vulnerability data during the build.

Incorrect Answers

A:

An Azure Monitor alert query check can block resource consumption while relevant monitored conditions violate deployment criteria; although that supports operational health gating before rollout, this scenario calls for third-party package risk detection.

B:

The code coverage publishing step imports supported reports from test tools into the pipeline's coverage reporting surface; third-party package risk detection cannot be inferred from visible code coverage artifact alone.

D:

A coverage-checking script or quality gate evaluates the computed metric against a threshold and returns a failing status when unmet; third-party package risk detection cannot be delivered through enforced minimum tested-code percentage.

Question 224

Temporary QA environments are left running for months and cost accumulates; what provisioning lifecycle should be introduced?

  1. Use policy-as-code in deployment pipelines
  2. Use configuration-as-code in source control
  3. Use configuration drift remediation only after impact review
  4. Use environment expiration or cleanup automation

Explanation

Correct Answer

D:

Automated teardown or time-to-live policies remove short-lived environments once they are no longer required. Associate creation with a scheduled expiration or teardown workflow, and verify that owned resources are removed.

Incorrect Answers

A:

Policy-as-code captures machine-readable guardrails in version control and automates validation during delivery; bounded ephemeral environment lifetime falls outside the scope of versioned infrastructure policy definitions.

B:

Storing configuration definitions in Git enables history, review, and automated validation like application code; it contributes to auditable machine configuration changes, with bounded ephemeral environment lifetime still requiring its own control.

C:

Desired-state remediation should account for approved exceptions and operational risk instead of blindly overwriting all detected changes; this solves governed drift correction, leaving bounded ephemeral environment lifetime unresolved.

Question 225

During rolling deployment, long-running requests fail when instances are removed abruptly. What load-balancing behavior should be added?

  1. Use health-based automatic rollback
  2. Drain connections before removing old replicas
  3. Apply expand-and-contract database migration
  4. Configure slot-sticky settings

Explanation

Correct Answer

B:

Connection draining and graceful termination allow in-flight requests to complete before a retiring instance stops.

Incorrect Answers

A:

Rollback automation tied to defined health signals can revert traffic or restore a prior version before failure spreads broadly; metric-triggered rapid restoration concerns a different control point than preserving active requests during replacement.

C:

Expand-and-contract migrations introduce backward-compatible schema changes first, transition consumers, and remove old structures only after compatibility is no longer needed; although that supports schema compatibility during version overlap, this scenario calls for preserving active requests during replacement.

D:

Deployment slot settings remain tied to their designated slot during swaps, preserving environment-specific configuration; preserving active requests during replacement cannot be inferred from retaining environment credentials across swaps alone.

Question 226

A shared variable group contains production credentials, and only approved deployment pipelines may read it. Which control protects access?

  1. Use protected variable groups for secrets
  2. Avoid expanding secrets into compile-time templates
  3. Create a steps template for repeated build commands
  4. Create a jobs template for common verification jobs
  5. Keep templates in source control

Explanation

Correct Answer

A:

Variable groups can be authorized for specific pipelines and supplemented with approvals or checks where supported.

Incorrect Answers

B:

Runtime secret variables or Key Vault retrieval keep sensitive values out of source-controlled template expansion and minimize accidental disclosure; separating secrets from YAML compilation cannot substitute for authorized shared-secret consumption.

C:

A steps template packages common task sequences for inclusion by multiple pipelines without duplicating source text; authorized shared-secret consumption falls outside the scope of reusable task sequence.

D:

A jobs template encapsulates job definitions so each caller obtains the same validated worker and task structure; it contributes to reusable complete job, with authorized shared-secret consumption still requiring its own control.

E:

Storing YAML templates in version control provides pull request review, history, and reproducible pipeline definitions; this solves auditable pipeline-as-code evolution, leaving authorized shared-secret consumption unresolved.

Question 227

A GitHub pull request updates rapidly and validation results must correspond to the tested revision, not a moving target reference. What should be preserved?

  1. Connect GitHub via the Azure Pipelines GitHub App
  2. Use the repository commit for PR validation
  3. Use a repository alias for cross-repository templates
  4. Configure GitHub status checks for Azure Pipeline validation

Explanation

Correct Answer

B:

The pipeline run's source version identifies the precise commit or merge revision that the validation operated on.

Incorrect Answers

A:

The Azure Pipelines GitHub App authorizes access to selected repositories and integrates pipeline checks with GitHub pull requests; immutable PR validation revision remains outside the responsibility of app-scoped GitHub pipeline integration.

C:

A named repository resource alias identifies the intended external template source and disambiguates references across the imported repositories; unambiguous template repository selection concerns a different control point than immutable PR validation revision.

D:

The pipeline reports status, while GitHub branch rules must explicitly require the relevant status check before merge; here immutable PR validation revision is the target, not mandatory consumption of external CI status.

Question 228

A GitHub PR shows an Azure Pipelines job result, but merging remains possible after that check fails. Which GitHub control is missing?

  1. Use the repository commit for PR validation
  2. Configure GitHub status checks for Azure Pipeline validation
  3. Use pipeline resource artifact download
  4. Connect GitHub via the Azure Pipelines GitHub App
  5. Use multiple checkout steps

Explanation

Correct Answer

B:

The pipeline reports status, while GitHub branch rules must explicitly require the relevant status check before merge.

Incorrect Answers

A:

The pipeline run's source version identifies the precise commit or merge revision that the validation operated on; mandatory consumption of external CI status cannot be delivered through immutable PR validation revision.

C:

Pipeline resources identify producer pipelines and their runs so downstream workflows can download associated build artifacts; that changes downstream consumption of upstream build output without delivering mandatory consumption of external CI status.

D:

The Azure Pipelines GitHub App authorizes access to selected repositories and integrates pipeline checks with GitHub pull requests; app-scoped GitHub pipeline integration cannot substitute for mandatory consumption of external CI status.

E:

Multiple checkout steps fetch the primary and declared secondary repositories into the job workspace; mandatory consumption of external CI status falls outside the scope of simultaneous workspace repository access.

Question 229

Three services have unrelated access policies, release cycles, and maintenance owners; combined history creates unnecessary coordination. Which repo strategy reduces coupling?

  1. Split independent services into separate repos
  2. Use Scalar for very large Git repositories
  3. Use Git submodules when pinning a separate repository
  4. Track large binaries with Git LFS

Explanation

Correct Answer

A:

Separate repositories allow independent branch protections, permission boundaries, and delivery lifecycles for unrelated services.

Incorrect Answers

B:

Scalar manages Git settings and background maintenance features designed to improve large-repository experience; it handles large-repository Git maintenance but cannot by itself deliver independent service governance.

C:

A submodule records a commit pointer to another repository, so the superproject pins a chosen revision; independent service governance remains outside the responsibility of separately versioned repository reference.

D:

Git Large File Storage replaces tracked large-file content with pointers in Git and stores binary objects in separate LFS storage; that acts on separating bulky assets from Git history, whereas the requested outcome is independent service governance.

Question 230

Five repositories must share a full security workflow with standardized permissions and secret handling. Which reuse mechanism is appropriate?

  1. Use reusable GitHub Actions workflows
  2. Use a self-hosted GitHub runner for specialist hardware
  3. Upload workflow artifacts for later jobs
  4. Restrict GITHUB_TOKEN permissions
  5. Use runner groups for administrative boundaries

Explanation

Correct Answer

A:

Reusable workflows called through workflow_call centralize a multi-job pattern while allowing controlled inputs from callers.

Incorrect Answers

B:

Self-hosted runners execute jobs on administrator-managed machines where specialized devices and licensed tools can be installed; the distinction is workflow access to custom hardware versus shared end-to-end GitHub automation.

C:

Artifact upload stores files associated with a workflow run outside the temporary runner filesystem; shared end-to-end GitHub automation cannot be delivered through durable GitHub test attachments.

D:

Declaring minimal permissions at workflow or job scope reduces the authority of the automatically issued GITHUB_TOKEN; its effect is least-privilege native workflow token, not shared end-to-end GitHub automation.

E:

Runner groups can control which repositories may use a collection of organization or enterprise runners; that changes scoped access to GitHub runner fleets without delivering shared end-to-end GitHub automation.

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