Microsoft AZ-400 Practice Test 40
Question 390
The DevOps team must resolve this situation: A shared variable group contains production connection strings, and every development pipeline can read them. Which engineering action is MOST appropriate?
- Create a controlled matrix over required operating systems and runtime versions.
- Separate production variables and restrict group use to approved production pipelines.
- Include explicit succeeded dependencies in the custom promotion condition.
- Configure trusted GitHub OIDC federation and least-privilege Azure roles for the deployment.
Explanation
Correct Answer
B:Separate production variables and restrict group use to approved production pipelines. This action addresses the specific failure or requirement and preserves delivery controls. Validation criterion: An untrusted development pipeline cannot read production variable values. Variable groups must have environment-specific authorization and secret access controls.
Incorrect Answers
A:Create a controlled matrix over required operating systems and runtime versions. This would address a different situation, such as: A cross-platform CLI is built only on Windows and fails later when customers run it on Linux. In the present case, the most directly relevant engineering action is: Separate production variables and restrict group use to approved production pipelines. The crucial distinction is: Variable groups must have environment-specific authorization and secret access controls.
C:Include explicit succeeded dependencies in the custom promotion condition. This would address a different situation, such as: A post-deployment verification job runs even when staging tests fail because its condition overrides the default dependency check. In the present case, the most directly relevant engineering action is: Separate production variables and restrict group use to approved production pipelines. The crucial distinction is: Variable groups must have environment-specific authorization and secret access controls.
D:Configure trusted GitHub OIDC federation and least-privilege Azure roles for the deployment. This would address a different situation, such as: A GitHub Actions release stores a long-lived Azure service principal password in repository secrets for every deployment. In the present case, the most directly relevant engineering action is: Separate production variables and restrict group use to approved production pipelines. The crucial distinction is: Variable groups must have environment-specific authorization and secret access controls.
Question 391
After implementing the change, the team verifies: Builds fail after an Azure Pipelines hosted image update because a legacy runtime was implicitly available before. Which result would BEST demonstrate that the issue is corrected?
- The same full test suite finishes faster without skipped checks.
- Maintained releases build correctly after old feed access is withdrawn.
- A representative flaky test appears as a reliability issue despite eventual job success.
- A clean replacement hosted image reproduces the expected build.
Explanation
Correct Answer
D:A clean replacement hosted image reproduces the expected build. This measures the actual expected outcome, rather than trusting only a configuration flag. Implemented action: Pin or explicitly install supported toolchains and test migrations before image retirement. Pipelines should declare supported tooling instead of depending on incidental agent image contents.
Incorrect Answers
A:The same full test suite finishes faster without skipped checks. This would address a different situation, such as: A large build spends most of its time serially running three independent test suites. In the present case, the most directly relevant verification is: A clean replacement hosted image reproduces the expected build. The crucial distinction is: Pipelines should declare supported tooling instead of depending on incidental agent image contents.
B:Maintained releases build correctly after old feed access is withdrawn. This would address a different situation, such as: A package registry is scheduled for migration, but retired feeds still contain dependencies used by maintained builds. In the present case, the most directly relevant verification is: A clean replacement hosted image reproduces the expected build. The crucial distinction is: Pipelines should declare supported tooling instead of depending on incidental agent image contents.
C:A representative flaky test appears as a reliability issue despite eventual job success. This would address a different situation, such as: Pipeline duration grows because a flaky test is retried eight times but the dashboard still shows every build as green. In the present case, the most directly relevant verification is: A clean replacement hosted image reproduces the expected build. The crucial distinction is: Pipelines should declare supported tooling instead of depending on incidental agent image contents.
Question 392
An Azure DevOps engineering team evaluates this condition: Teams each copy a deployment YAML template and security fixes reach only some repositories. Which DevOps principle BEST explains the underlying weakness?
- Pipeline triggers must enforce reviewed source ref eligibility.
- Shared templates should be centrally governed and versioned for compatible consumers.
- Cross-stage values must be explicitly published and referenced through supported output syntax.
- Agent placement should satisfy network access and security constraints without overprivilege.
Explanation
Correct Answer
B:Shared templates should be centrally governed and versioned for compatible consumers. This principle identifies the risk or delivery weakness in the case. Relevant evidence: Compare duplicated YAML, referenced template versions, access rules and review practices. An appropriate controlled response is: Move common steps into approved reusable templates with pinned or governed references.
Incorrect Answers
A:Pipeline triggers must enforce reviewed source ref eligibility. This would address a different situation, such as: A deployment pipeline runs on feature-branch pushes despite a policy requiring releases only from protected main. In the present case, the most directly relevant principle is: Shared templates should be centrally governed and versioned for compatible consumers. The crucial distinction is: Shared templates should be centrally governed and versioned for compatible consumers.
C:Cross-stage values must be explicitly published and referenced through supported output syntax. This would address a different situation, such as: A downstream stage cannot determine the storage endpoint created by an infrastructure provisioning stage. In the present case, the most directly relevant principle is: Shared templates should be centrally governed and versioned for compatible consumers. The crucial distinction is: Shared templates should be centrally governed and versioned for compatible consumers.
D:Agent placement should satisfy network access and security constraints without overprivilege. This would address a different situation, such as: A build must reach private package infrastructure inaccessible from Microsoft-hosted agents. In the present case, the most directly relevant principle is: Shared templates should be centrally governed and versioned for compatible consumers. The crucial distinction is: Shared templates should be centrally governed and versioned for compatible consumers.
Question 393
An Azure DevOps engineering team evaluates this condition: A GitHub environment is protected, but the deployment job obtains Azure credentials in an earlier unprotected build step. Which DevOps principle BEST explains the underlying weakness?
- Pipeline secrets should be retrieved from controlled stores and kept out of source and logs.
- Secret rotation must coordinate client update, version retention and recovery.
- Credential issuance should occur only after the protected environment gate and trust checks.
- OIDC federation trust should restrict audience, issuer and repository/environment subject.
Explanation
Correct Answer
C:Credential issuance should occur only after the protected environment gate and trust checks. This principle identifies the risk or delivery weakness in the case. Relevant evidence: Review workflow job ordering, environment references, OIDC identity claims and Azure role scope. An appropriate controlled response is: Move cloud credential issuance into the guarded deployment job with scoped federation.
Incorrect Answers
A:Pipeline secrets should be retrieved from controlled stores and kept out of source and logs. This would address a different situation, such as: A pipeline prints a database password stored in a plain YAML variable during environment deployment. In the present case, the most directly relevant principle is: Credential issuance should occur only after the protected environment gate and trust checks. The crucial distinction is: Credential issuance should occur only after the protected environment gate and trust checks.
B:Secret rotation must coordinate client update, version retention and recovery. This would address a different situation, such as: An application release references a database secret version that was deleted during automatic rotation, causing downtime. In the present case, the most directly relevant principle is: Credential issuance should occur only after the protected environment gate and trust checks. The crucial distinction is: Credential issuance should occur only after the protected environment gate and trust checks.
D:OIDC federation trust should restrict audience, issuer and repository/environment subject. This would address a different situation, such as: A federated Azure identity accepts tokens from any branch in a public GitHub repository and can deploy production resources. In the present case, the most directly relevant principle is: Credential issuance should occur only after the protected environment gate and trust checks. The crucial distinction is: Credential issuance should occur only after the protected environment gate and trust checks.
Question 394
After implementing the change, the team verifies: A test task writes its service principal secret into verbose logs on every failing run. Which result would BEST demonstrate that the issue is corrected?
- A deliberately unresolved critical issue prevents production promotion until authorized disposition.
- A controlled failing test produces useful diagnostics without leaking the credential.
- Repeated runs produce stable results without masking functional failures.
- A destructive test cannot modify the protected production storage account.
Explanation
Correct Answer
B:A controlled failing test produces useful diagnostics without leaking the credential. This measures the actual expected outcome, rather than trusting only a configuration flag. Implemented action: Move test credentials into a protected secret store and suppress token output. Testing pipelines must avoid exposing credentials while preserving useful diagnostics.
Incorrect Answers
A:A deliberately unresolved critical issue prevents production promotion until authorized disposition. This would address a different situation, such as: A deployment receives approval even when a required penetration-test issue remains unresolved and unaccepted. In the present case, the most directly relevant verification is: A controlled failing test produces useful diagnostics without leaking the credential. The crucial distinction is: Testing pipelines must avoid exposing credentials while preserving useful diagnostics.
C:Repeated runs produce stable results without masking functional failures. This would address a different situation, such as: A nightly integration suite fails intermittently because test data is shared between parallel jobs. In the present case, the most directly relevant verification is: A controlled failing test produces useful diagnostics without leaking the credential. The crucial distinction is: Testing pipelines must avoid exposing credentials while preserving useful diagnostics.
D:A destructive test cannot modify the protected production storage account. This would address a different situation, such as: A test pipeline reuses a production storage account and occasionally deletes customer fixtures. In the present case, the most directly relevant verification is: A controlled failing test produces useful diagnostics without leaking the credential. The crucial distinction is: Testing pipelines must avoid exposing credentials while preserving useful diagnostics.
Question 395
An Azure DevOps engineering team evaluates this condition: An API's new release increases CPU costs by 60%, but the load test reports green because no baseline exists. Which DevOps principle BEST explains the underlying weakness?
- Security policy gates should prevent release of unapproved critical vulnerabilities.
- CI test reporting must propagate failure status and publish actionable test results.
- Performance testing should compare measured changes against approved regression budgets.
- Unit test gates should complete successfully against the proposed change before merge.
Explanation
Correct Answer
C:Performance testing should compare measured changes against approved regression budgets. This principle identifies the risk or delivery weakness in the case. Relevant evidence: Review prior performance runs, cost metrics, current profile and thresholds. An appropriate controlled response is: Implement repeatable baseline comparison gates for resource consumption and latency.
Incorrect Answers
A:Security policy gates should prevent release of unapproved critical vulnerabilities. This would address a different situation, such as: A container image with a known critical vulnerability passes all unit tests and is promoted to production. In the present case, the most directly relevant principle is: Performance testing should compare measured changes against approved regression budgets. The crucial distinction is: Performance testing should compare measured changes against approved regression budgets.
B:CI test reporting must propagate failure status and publish actionable test results. This would address a different situation, such as: A pipeline script prints a test failure but exits with zero, leaving no test results visible in Azure Pipelines. In the present case, the most directly relevant principle is: Performance testing should compare measured changes against approved regression budgets. The crucial distinction is: Performance testing should compare measured changes against approved regression budgets.
D:Unit test gates should complete successfully against the proposed change before merge. This would address a different situation, such as: A protected mainline accepts pull requests before a required unit test suite finishes, causing broken packages. In the present case, the most directly relevant principle is: Performance testing should compare measured changes against approved regression budgets. The crucial distinction is: Performance testing should compare measured changes against approved regression budgets.
Question 396
An Azure DevOps engineering team evaluates this condition: A QA vendor needs read-only test access but has been granted repository administration rights. Which DevOps principle BEST explains the underlying weakness?
- Large repositories can use sparse checkout and partial clone to reduce unnecessary working data.
- Repository access should be limited to the minimum collaborator operations.
- Repository hygiene needs tracked-artifact policy and planned history repair when necessary.
- Cross-repository reuse needs an explicit versioned dependency strategy.
Explanation
Correct Answer
B:Repository access should be limited to the minimum collaborator operations. This principle identifies the risk or delivery weakness in the case. Relevant evidence: Inspect project access groups, repository ACLs, token grants and vendor responsibilities. An appropriate controlled response is: Assign a read-only or suitably scoped collaborator role and remove administrative privileges.
Incorrect Answers
A:Large repositories can use sparse checkout and partial clone to reduce unnecessary working data. This would address a different situation, such as: A developer needs one service from a huge monorepo, but each checkout transfers every unrelated project and binary. In the present case, the most directly relevant principle is: Repository access should be limited to the minimum collaborator operations. The crucial distinction is: Repository access should be limited to the minimum collaborator operations.
C:Repository hygiene needs tracked-artifact policy and planned history repair when necessary. This would address a different situation, such as: A project accidentally committed generated build outputs and its repository history grew by several gigabytes. In the present case, the most directly relevant principle is: Repository access should be limited to the minimum collaborator operations. The crucial distinction is: Repository access should be limited to the minimum collaborator operations.
D:Cross-repository reuse needs an explicit versioned dependency strategy. This would address a different situation, such as: Two separate repositories copy and edit a common authentication library independently, producing inconsistent fixes. In the present case, the most directly relevant principle is: Repository access should be limited to the minimum collaborator operations. The crucial distinction is: Repository access should be limited to the minimum collaborator operations.
Question 397
An Azure DevOps engineering team evaluates this condition: A release database task retries after a timeout and creates duplicate schema objects, causing subsequent deployments to fail. Which DevOps principle BEST explains the underlying weakness?
- Feature flag control separates deployment from governed feature activation.
- Database deployment scripts should be repeatable or safely versioned with migration state.
- Infrastructure deployment should preview and approve material changes before applying.
- Deployments should reference the exact verified image digest or protected immutable tag.
Explanation
Correct Answer
B:Database deployment scripts should be repeatable or safely versioned with migration state. This principle identifies the risk or delivery weakness in the case. Relevant evidence: Inspect schema migration history, transaction boundaries, retry logs and object existence. An appropriate controlled response is: Use a controlled migration framework with version tracking and idempotent safeguards.
Incorrect Answers
A:Feature flag control separates deployment from governed feature activation. This would address a different situation, such as: A half-finished payment feature accidentally activates immediately when its code merges into main. In the present case, the most directly relevant principle is: Database deployment scripts should be repeatable or safely versioned with migration state. The crucial distinction is: Database deployment scripts should be repeatable or safely versioned with migration state.
C:Infrastructure deployment should preview and approve material changes before applying. This would address a different situation, such as: A Terraform pipeline applies a production plan without showing that a changed resource will be destroyed. In the present case, the most directly relevant principle is: Database deployment scripts should be repeatable or safely versioned with migration state. The crucial distinction is: Database deployment scripts should be repeatable or safely versioned with migration state.
D:Deployments should reference the exact verified image digest or protected immutable tag. This would address a different situation, such as: A release manifest references an ACR latest tag that was replaced after QA approval. In the present case, the most directly relevant principle is: Database deployment scripts should be repeatable or safely versioned with migration state. The crucial distinction is: Database deployment scripts should be repeatable or safely versioned with migration state.
Question 398
A Microsoft DevOps team is addressing: A cross-platform CLI is built only on Windows and fails later when customers run it on Linux. Which TWO complementary actions should be taken? Select TWO answers.
- Inspect repository runner group rules, fork workflow triggers and credential persistence.
- Configure approved GitHub connection permissions and required PR build validation.
- Inspect GitHub workflow permissions, Entra federated identity credentials, scopes and token audience.
- Create a controlled matrix over required operating systems and runtime versions.
- Inspect supported OS/runtime targets, build matrix and test coverage.
Explanation
Correct Answers
D:Create a controlled matrix over required operating systems and runtime versions. This supplies the controlled implementation needed for the scenario. Its complementary step is: Inspect supported OS/runtime targets, build matrix and test coverage. Together they address: Matrix job strategies can validate supported platforms from one pipeline definition.
E:Inspect supported OS/runtime targets, build matrix and test coverage. This supplies the diagnosis/evidence needed for the scenario. Its complementary step is: Create a controlled matrix over required operating systems and runtime versions. Together they address: Matrix job strategies can validate supported platforms from one pipeline definition.
Incorrect Answers
A:Inspect repository runner group rules, fork workflow triggers and credential persistence. This concerns a different DevOps situation: A GitHub self-hosted runner accepts workflows from untrusted forks and shares its workspace with production credentials. This case instead requires both a targeted investigation (Inspect supported OS/runtime targets, build matrix and test coverage.) and a controlled change (Create a controlled matrix over required operating systems and runtime versions.).
B:Configure approved GitHub connection permissions and required PR build validation. This concerns a different DevOps situation: An Azure DevOps pipeline uses a GitHub repository but cannot run pull-request validation because its repository connection is misconfigured. This case instead requires both a targeted investigation (Inspect supported OS/runtime targets, build matrix and test coverage.) and a controlled change (Create a controlled matrix over required operating systems and runtime versions.).
C:Inspect GitHub workflow permissions, Entra federated identity credentials, scopes and token audience. This concerns a different DevOps situation: A GitHub Actions release stores a long-lived Azure service principal password in repository secrets for every deployment. This case instead requires both a targeted investigation (Inspect supported OS/runtime targets, build matrix and test coverage.) and a controlled change (Create a controlled matrix over required operating systems and runtime versions.).
Question 399
A Microsoft DevOps team is addressing: A pipeline publishes Python wheels from a feed after an advisory identifies a vulnerable indirect dependency. Which TWO complementary actions should be taken? Select TWO answers.
- Grant read, publish and administration only to the appropriate separate identities.
- Inspect package visibility, repository grant, GITHUB_TOKEN permissions and workflow context.
- Inspect dependency resolution reports, advisory scope, wheel metadata and test outcomes.
- Inspect build timestamps, package versions, artifact digests and update metadata.
- Update to an approved secure dependency version and rerun integration and compatibility checks.
Explanation
Correct Answers
C:Inspect dependency resolution reports, advisory scope, wheel metadata and test outcomes. This supplies the diagnosis/evidence needed for the scenario. Its complementary step is: Update to an approved secure dependency version and rerun integration and compatibility checks. Together they address: Dependency governance needs timely security updates while preserving compatibility testing.
E:Update to an approved secure dependency version and rerun integration and compatibility checks. This supplies the controlled implementation needed for the scenario. Its complementary step is: Inspect dependency resolution reports, advisory scope, wheel metadata and test outcomes. Together they address: Dependency governance needs timely security updates while preserving compatibility testing.
Incorrect Answers
A:Grant read, publish and administration only to the appropriate separate identities. This concerns a different DevOps situation: Every developer can delete the versions of a private production library that other teams depend on. This case instead requires both a targeted investigation (Inspect dependency resolution reports, advisory scope, wheel metadata and test outcomes.) and a controlled change (Update to an approved secure dependency version and rerun integration and compatibility checks.).
B:Inspect package visibility, repository grant, GITHUB_TOKEN permissions and workflow context. This concerns a different DevOps situation: A GitHub Actions workflow receives 403 when installing a private package owned by another organization repository. This case instead requires both a targeted investigation (Inspect dependency resolution reports, advisory scope, wheel metadata and test outcomes.) and a controlled change (Update to an approved secure dependency version and rerun integration and compatibility checks.).
D:Inspect build timestamps, package versions, artifact digests and update metadata. This concerns a different DevOps situation: An organization uses calendar-versioned nightly internal tools but deployments cannot distinguish two builds made on the same day. This case instead requires both a targeted investigation (Inspect dependency resolution reports, advisory scope, wheel metadata and test outcomes.) and a controlled change (Update to an approved secure dependency version and rerun integration and compatibility checks.).
Question 400
The DevOps team must resolve this situation: A container image with a known critical vulnerability passes all unit tests and is promoted to production. Which engineering action is MOST appropriate?
- Implement repeatable baseline comparison gates for resource consumption and latency.
- Add a risk-based container vulnerability scan gate before deployment approval.
- Improve boundary-value assertions and use mutation or targeted fault tests as appropriate.
- Run supported code scanning on pull requests with risk-appropriate merge gates.
Explanation
Correct Answer
B:Add a risk-based container vulnerability scan gate before deployment approval. This action addresses the specific failure or requirement and preserves delivery controls. Validation criterion: An intentionally vulnerable test image is blocked and an approved fixed image proceeds. Security policy gates should prevent release of unapproved critical vulnerabilities.
Incorrect Answers
A:Implement repeatable baseline comparison gates for resource consumption and latency. This would address a different situation, such as: An API's new release increases CPU costs by 60%, but the load test reports green because no baseline exists. In the present case, the most directly relevant engineering action is: Add a risk-based container vulnerability scan gate before deployment approval. The crucial distinction is: Security policy gates should prevent release of unapproved critical vulnerabilities.
C:Improve boundary-value assertions and use mutation or targeted fault tests as appropriate. This would address a different situation, such as: A business rule has 100% line coverage, but tests still pass when its comparison operator is reversed. In the present case, the most directly relevant engineering action is: Add a risk-based container vulnerability scan gate before deployment approval. The crucial distinction is: Security policy gates should prevent release of unapproved critical vulnerabilities.
D:Run supported code scanning on pull requests with risk-appropriate merge gates. This would address a different situation, such as: A GitHub repository scans vulnerabilities once a month but merges vulnerable code daily. In the present case, the most directly relevant engineering action is: Add a risk-based container vulnerability scan gate before deployment approval. The crucial distinction is: Security policy gates should prevent release of unapproved critical vulnerabilities.