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

Question 330

A deployment pipeline sometimes retries after a network failure; running a setup script twice must not create duplicate resources. Which property should the scripts have?

  1. Use idempotent deployment scripts
  2. Use Azure App Service deployment slots
  3. Use readiness probes behind a load balancer
  4. Drain connections before removing old replicas

Explanation

Correct Answer

A:

Idempotent operations reach the desired end state even when repeated, making safe retries possible after partial execution.

Incorrect Answers

B:

Deployment slots host alternate app versions and support swaps, reducing visible downtime when slot settings are correctly configured; warm-before-cutover web deployment concerns a different control point than repeatable partial deployment recovery.

C:

Readiness checks keep instances out of eligible traffic rotation until they can serve real requests; here repeatable partial deployment recovery is the target, not traffic admission after application readiness.

D:

Connection draining and graceful termination allow in-flight requests to complete before a retiring instance stops; although that supports preserving active requests during replacement, this scenario calls for repeatable partial deployment recovery.

Question 331

Pull requests into main require tests before review is completed, including when commits are added to an existing PR. Which GitHub Actions event should trigger the workflow?

  1. Use Azure Repos build validation instead of YAML PR trigger
  2. Filter GitHub workflow events by branch and path
  3. Use batch for overlapping Azure Pipeline CI pushes
  4. Configure a GitHub pull_request workflow trigger

Explanation

Correct Answer

D:

The pull_request event runs selected workflows for PR activities, enabling validation before code is merged. Include the relevant PR activity types and target branches so later commits receive the same validation.

Incorrect Answers

A:

Azure Repos Git PR validation is configured through branch build-validation policies rather than relying on the YAML pr trigger used for other repository providers; its effect is Azure Repos target-branch PR validation, not GitHub proposed-change verification.

B:

GitHub Actions event configuration can combine target branch and path filters to limit runs to relevant proposed changes; that changes combined PR target and file selection without delivering GitHub proposed-change verification.

C:

Azure Pipelines CI batching can aggregate changes while a branch build is running, reducing unnecessary intermediate runs; coalescing frequent branch updates cannot substitute for GitHub proposed-change verification.

Question 332

A security operations team uses Defender for Cloud for risk triage and needs supported GitHub repository findings represented there. Which integration should be assessed?

  1. Define vulnerability severity thresholds for release decisions
  2. Connect GitHub Advanced Security findings to Defender for Cloud
  3. Require secret scan checks before publishing
  4. Use least-privilege tokens for security scanners

Explanation

Correct Answer

B:

Supported integration of GitHub Advanced Security with Defender for Cloud can bring repository security signals into cloud-focused posture views.

Incorrect Answers

A:

A documented risk-based scanning policy defines failure thresholds and exception handling rather than treating every scanner finding equally; it handles policy-driven vulnerability release gate but cannot by itself deliver unified repository vulnerability posture.

C:

Secret detection applied to source and built artifacts can block distribution when sensitive credential patterns are found; that acts on prepublication credential leakage gate, whereas the requested outcome is unified repository vulnerability posture.

D:

Grant only the API permissions necessary to retrieve code and publish assessment results, keeping repository administration separate; narrow automation scanner identity concerns a different control point than unified repository vulnerability posture.

Question 333

A production credential was printed in a public build log; removing the log is planned, but the token might already have been copied. Which response is mandatory?

  1. Mask sensitive values in logs
  2. Avoid echoing command-line credentials
  3. Restrict permissions to download signing secure files
  4. Use managed identity for Key Vault retrieval
  5. Use Key Vault certificates for managed certificate lifecycle
  6. Rotate a compromised secret at the source

Explanation

Correct Answer

F:

Revoking and replacing the disclosed credential removes its future utility even if historical exposure cannot be undone.

Incorrect Answers

A:

Secret masking and safe command invocation reduce exposure, but scripts should avoid emitting credentials because redaction is not foolproof; the distinction is protection of pipeline log output versus containment after secret disclosure.

B:

Supply credentials through protected inputs or supported environment mechanisms rather than exposing them in printed arguments; containment after secret disclosure cannot be delivered through nonlogged secret delivery to tools.

C:

Secure-file pipeline permissions limit which definitions may download protected file assets during runs; its effect is signing file consumer allowlist, not containment after secret disclosure.

D:

A managed identity lets supported Azure resources authenticate to Key Vault with Entra tokens and assigned data access; that changes Azure-hosted secret access without local credentials without delivering containment after secret disclosure.

E:

Key Vault certificate objects manage certificate lifecycle and associated keys or secret representations under configured access policy; managed application certificate storage cannot substitute for containment after secret disclosure.

Question 334

Reviewers say enormous changes are delaying approval; what metric can quantify the issue beyond counting pull requests?

  1. Track mean time to detect
  2. Use a vulnerability severity dashboard
  3. Use pull request size distribution
  4. Use Azure Boards shared queries for team reporting
  5. Track rollback count by release

Explanation

Correct Answer

C:

Changed lines or files per pull request expose review batch size and help teams find a healthier incremental change size.

Incorrect Answers

A:

Mean time to detect measures detection latency and indicates how effectively monitoring surfaces incidents after they begin; this solves incident detection delay, leaving code review change batch size unresolved.

B:

Vulnerability reporting should group detected findings by severity, affected asset, and remediation status rather than only build totals; this option addresses risk-ranked outstanding findings rather than addressing code review change batch size.

D:

Shared queries are accessible to authorized project members and can power work item query results on team dashboards; code review change batch size remains outside the responsibility of reusable project-wide work queries.

E:

Rollback frequency counts production deployments that are reverted and indicates a release quality problem not visible in build pass rates; that acts on reversal rate after delivery, whereas the requested outcome is code review change batch size.

Question 335

Multiple product projects already share a security governance model and need one centrally managed dependency source. Which feed scope best reduces duplication?

  1. Use an organization-scoped feed for shared components
  2. Promote tested packages to a release view
  3. Use GitHub Packages with repository permissions
  4. Use project-scoped feeds for narrow ownership

Explanation

Correct Answer

A:

Organization-scoped Azure Artifacts feeds support cross-project package reuse through common feed permissions and endpoints.

Incorrect Answers

B:

Azure Artifacts views such as release-oriented views expose selected package versions as a curated subset of a feed; organization-wide dependency catalog cannot be inferred from vetted package visibility boundary alone.

C:

GitHub Packages supports publishing and retrieving supported package formats while tying packages to GitHub access models where applicable; the distinction is GitHub-native package hosting versus organization-wide dependency catalog.

D:

Project-scoped feeds align package access with project boundaries and can authorize external projects explicitly; organization-wide dependency catalog cannot be delivered through project-bounded package administration.

Question 336

A build must include a specific commit of an independently maintained dependency repository and preserve its identity. Which Git feature fits?

  1. Track large binaries with Git LFS
  2. Use Git submodules when pinning a separate repository
  3. Add .gitignore for local build outputs
  4. Split independent services into separate repos
  5. Use repository path-based ownership

Explanation

Correct Answer

B:

A submodule records a commit pointer to another repository, so the superproject pins a chosen revision. The referenced commit must remain accessible in the dependency repository, and the pipeline needs permission to fetch it.

Incorrect Answers

A:

Git Large File Storage replaces tracked large-file content with pointers in Git and stores binary objects in separate LFS storage; separately versioned repository reference falls outside the scope of separating bulky assets from Git history.

C:

The .gitignore file lists untracked path patterns Git should ignore; previously tracked files need separate untracking; this solves exclude machine-local generated files, leaving separately versioned repository reference unresolved.

D:

Separate repositories allow independent branch protections, permission boundaries, and delivery lifecycles for unrelated services; this option addresses independent service governance rather than addressing separately versioned repository reference.

E:

CODEOWNERS maps repository path patterns to responsible reviewers and aids targeted review governance; it handles ownership within one large repository but cannot by itself deliver separately versioned repository reference.

Question 337

Several deployment pipelines need current protected values from the same approved vault without copying values into each YAML file. Which integration should be used?

  1. Rotate a compromised secret at the source
  2. Use secret rotation without rebuilding application binaries
  3. Prefer workload federation over stored cloud secrets
  4. Use an Azure Pipelines Key Vault-linked variable group

Explanation

Correct Answer

D:

A Key Vault-linked variable group maps selected vault secrets into authorized pipelines at runtime. Authorized pipelines can resolve selected vault-backed values without hardcoding them in every pipeline definition.

Incorrect Answers

A:

Revoking and replacing the disclosed credential removes its future utility even if historical exposure cannot be undone; containment after secret disclosure concerns a different control point than reusable protected vault references.

B:

External secret storage and supported runtime refresh or restart decouple credential lifecycle from application compilation; here reusable protected vault references is the target, not independent credential update lifecycle.

C:

OIDC or workload identity federation exchanges short-lived trust assertions for cloud tokens without long-lived stored application secrets; although that supports short-lived token-based cloud trust, this scenario calls for reusable protected vault references.

Question 338

A pipeline checks out the same large repository in jobs that only approve or deploy downloaded release packages. What should be eliminated?

  1. Reuse existing build output during classic-to-YAML migration
  2. Migrate classic pipeline tasks to YAML
  3. Shard a long test suite across workers
  4. Reduce redundant source checkout

Explanation

Correct Answer

D:

Skipping unnecessary checkout saves network transfer and startup time when source files are not consumed. Using checkout: none for a deployment-only job avoids cloning code that is already represented by downloaded artifacts.

Incorrect Answers

A:

Pipeline resources and artifact download steps let new YAML deployment stages consume an existing immutable build output; that changes migration without rebuilding the release without delivering elimination of unused Git fetch.

B:

YAML pipelines express jobs and steps as source-controlled definitions, improving change review and reproducibility; replacing GUI-only automation with code cannot substitute for elimination of unused Git fetch.

C:

Test sharding partitions cases among concurrent workers and combines their reports, reducing the duration of an otherwise serial test job; elimination of unused Git fetch falls outside the scope of distributed test-case execution.

Question 339

Database integration tests must never start until a packaging job completes successfully; the YAML currently treats jobs as parallel. What relationship is needed?

  1. Use stage-level conditions for branch-specific release
  2. Use failed() to capture error diagnostics
  3. Use a condition checking succeeded()
  4. Use dependsOn to order jobs

Explanation

Correct Answer

D:

A dependsOn relationship establishes an execution dependency between jobs or stages, enabling controlled ordering and status evaluation.

Incorrect Answers

A:

A stage condition can evaluate branch metadata alongside success state to prevent production deployment from nonapproved branches; explicit job prerequisite ordering remains outside the responsibility of branch-gated production stage.

B:

failed() gates the diagnostic step on a failure state so collection is targeted at broken runs; that acts on failure-specific evidence collection, whereas the requested outcome is explicit job prerequisite ordering.

C:

The succeeded() expression evaluates execution status and gates work on successful prerequisite completion; success-dependent execution concerns a different control point than explicit job prerequisite ordering.

Question 340

A latency query needs a calculated duration category while preserving the original raw columns for analysis. Which KQL operator applies?

  1. Use KQL extend for computed fields
  2. Use Container insights for AKS workloads
  3. Use KQL project to limit output columns
  4. Use Azure Monitor network monitoring

Explanation

Correct Answer

A:

extend adds calculated columns derived from existing expressions without requiring data to be rewritten at ingestion.

Incorrect Answers

B:

Container insights gathers supported Kubernetes inventory, performance, and log data to support workload and node diagnosis; its effect is cluster and pod health visibility, not calculated query result dimensions.

C:

project selects and can rename the columns returned by a KQL query, producing a focused investigation result; that changes KQL selected-column shaping without delivering calculated query result dimensions.

D:

Network monitoring capabilities integrate supported connectivity, flow, and performance signals for troubleshooting network paths; Azure network connection observability cannot substitute for calculated query result dimensions.

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