Microsoft AZ-400 Practice Test 1
Question 1
After implementing the change, the team verifies: A GitHub Actions test workflow with untrusted input has contents:write even though it only runs tests. Which result would BEST demonstrate that the issue is corrected?
- The app accesses its authorized container after the account key is revoked.
- A code author cannot self-approve a restricted deployment without a qualified reviewer.
- The auditor views the specified repo but cannot inspect unrelated private repositories.
- A test job cannot push code while an authorized publishing job retains needed access.
Explanation
Correct Answer
D:A test job cannot push code while an authorized publishing job retains needed access. This measures the actual expected outcome, rather than trusting only a configuration flag. Implemented action: Set minimum GITHUB_TOKEN permissions for each job and restrict untrusted execution. Workflow tokens should default to read-only and be elevated only where necessary.
Incorrect Answers
A:The app accesses its authorized container after the account key is revoked. This would address a different situation, such as: An App Service accesses Azure Storage using a connection string containing an account key in source control. In the present case, the most directly relevant verification is: A test job cannot push code while an authorized publishing job retains needed access. The crucial distinction is: Workflow tokens should default to read-only and be elevated only where necessary.
B:A code author cannot self-approve a restricted deployment without a qualified reviewer. This would address a different situation, such as: Developers can edit protected deployment environments and approve their own releases because one group owns all project settings. In the present case, the most directly relevant verification is: A test job cannot push code while an authorized publishing job retains needed access. The crucial distinction is: Workflow tokens should default to read-only and be elevated only where necessary.
C:The auditor views the specified repo but cannot inspect unrelated private repositories. This would address a different situation, such as: An external auditor needs read access to one private repository, but is added as an owner of the whole organization. In the present case, the most directly relevant verification is: A test job cannot push code while an authorized publishing job retains needed access. The crucial distinction is: Workflow tokens should default to read-only and be elevated only where necessary.
Question 2
After implementing the change, the team verifies: A nightly integration suite fails intermittently because test data is shared between parallel jobs. Which result would BEST demonstrate that the issue is corrected?
- A deliberately failing unit test prevents the pull request from merging.
- Repeated runs produce stable results without masking functional failures.
- Both app versions write correctly during transition and a rollback stays feasible.
- A bad connectivity rule fails before release while approved paths succeed.
Explanation
Correct Answer
B:Repeated runs produce stable results without masking functional failures. This measures the actual expected outcome, rather than trusting only a configuration flag. Implemented action: Give parallel tests isolated data and synchronize genuine shared dependencies. Reliable tests need deterministic data isolation and controlled concurrency.
Incorrect Answers
A:A deliberately failing unit test prevents the pull request from merging. 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 verification is: Repeated runs produce stable results without masking functional failures. The crucial distinction is: Reliable tests need deterministic data isolation and controlled concurrency.
C:Both app versions write correctly during transition and a rollback stays feasible. This would address a different situation, such as: A release adds a non-null column while old and new application versions temporarily operate together. In the present case, the most directly relevant verification is: Repeated runs produce stable results without masking functional failures. The crucial distinction is: Reliable tests need deterministic data isolation and controlled concurrency.
D:A bad connectivity rule fails before release while approved paths succeed. This would address a different situation, such as: Service unit tests pass but integration fails because Azure SQL connectivity differs between staging and production. In the present case, the most directly relevant verification is: Repeated runs produce stable results without masking functional failures. The crucial distinction is: Reliable tests need deterministic data isolation and controlled concurrency.
Question 3
Before changing the pipeline or service, engineers find: A package registry is scheduled for migration, but retired feeds still contain dependencies used by maintained builds. Which evidence should the engineer inspect FIRST?
- Review service connection mode, secret expiration, Azure RBAC and trust configuration.
- Inspect package restore sources, build manifests, feed versions and migration schedule.
- Inspect run timelines, environment approval events and task durations.
- Inspect pipeline resources, branch filters, artifact provenance and run IDs.
Explanation
Correct Answer
B:Inspect package restore sources, build manifests, feed versions and migration schedule. This directly checks the uncertain behavior or control before changing production. Pipeline migration must account for external dependencies and supported retention. The resulting targeted action is: Mirror or migrate required immutable package versions before switching consumers.
Incorrect Answers
A:Review service connection mode, secret expiration, Azure RBAC and trust configuration. This would address a different situation, such as: A legacy release service principal secret is set to expire tomorrow and pipeline maintenance has no automated credential lifecycle. In the present case, the most directly relevant evidence is: Inspect package restore sources, build manifests, feed versions and migration schedule. The crucial distinction is: Pipeline migration must account for external dependencies and supported retention.
C:Inspect run timelines, environment approval events and task durations. This would address a different situation, such as: An approval gate makes a release appear to take two hours, but actual deployment work takes five minutes. In the present case, the most directly relevant evidence is: Inspect package restore sources, build manifests, feed versions and migration schedule. The crucial distinction is: Pipeline migration must account for external dependencies and supported retention.
D:Inspect pipeline resources, branch filters, artifact provenance and run IDs. This would address a different situation, such as: A production stage sometimes downloads an artifact from a different branch due to an ambiguous pipeline resource definition. In the present case, the most directly relevant evidence is: Inspect package restore sources, build manifests, feed versions and migration schedule. The crucial distinction is: Pipeline migration must account for external dependencies and supported retention.
Question 4
The DevOps team must resolve this situation: A .NET service pulls internal NuGet libraries from a developer laptop because no shared feed exists. Which engineering action is MOST appropriate?
- Publish versioned internal packages to Azure Artifacts and grant scoped pipeline feed access.
- Configure an approved upstream source and appropriate package permissions in Azure Artifacts.
- Use unique versioned paths and verify digest before deployment.
- Promote and deploy verified image digests with approved version labels.
Explanation
Correct Answer
A:Publish versioned internal packages to Azure Artifacts and grant scoped pipeline feed access. This action addresses the specific failure or requirement and preserves delivery controls. Validation criterion: A clean hosted agent resolves the approved package without a developer workstation. Internal dependencies should be published to an authenticated, versioned package feed.
Incorrect Answers
B:Configure an approved upstream source and appropriate package permissions in Azure Artifacts. This would address a different situation, such as: A package feed cannot install vetted public dependencies during a disconnected corporate build unless developers manually copy files. In the present case, the most directly relevant engineering action is: Publish versioned internal packages to Azure Artifacts and grant scoped pipeline feed access. The crucial distinction is: Internal dependencies should be published to an authenticated, versioned package feed.
C:Use unique versioned paths and verify digest before deployment. This would address a different situation, such as: A build pipeline uploads a ZIP under a stable filename and a later build overwrites it before deployment. In the present case, the most directly relevant engineering action is: Publish versioned internal packages to Azure Artifacts and grant scoped pipeline feed access. The crucial distinction is: Internal dependencies should be published to an authenticated, versioned package feed.
D:Promote and deploy verified image digests with approved version labels. This would address a different situation, such as: A team overwrites the same image tag in Azure Container Registry for every build and loses reproducible deployment history. In the present case, the most directly relevant engineering action is: Publish versioned internal packages to Azure Artifacts and grant scoped pipeline feed access. The crucial distinction is: Internal dependencies should be published to an authenticated, versioned package feed.
Question 5
After implementing the change, the team verifies: A Bicep pipeline deploys wildcard role assignments despite a known rule requiring narrowly scoped access. Which result would BEST demonstrate that the issue is corrected?
- A repeat plan is stable and firewall rules match the reviewed configuration.
- A deliberately broad assignment fails the CI gate before deployment.
- A new prohibited test storage deployment is rejected while approved configurations succeed.
- A test environment creates approved resources and deprovisions under the policy.
Explanation
Correct Answer
B:A deliberately broad assignment fails the CI gate before deployment. This measures the actual expected outcome, rather than trusting only a configuration flag. Implemented action: Run Bicep validation and reviewed security rules with blocking policy for critical findings. IaC static analysis should detect risky patterns before production deployment.
Incorrect Answers
A:A repeat plan is stable and firewall rules match the reviewed configuration. This would address a different situation, such as: Operators modify a production firewall directly, but the Terraform plan assumes its prior values remain in place. In the present case, the most directly relevant verification is: A deliberately broad assignment fails the CI gate before deployment. The crucial distinction is: IaC static analysis should detect risky patterns before production deployment.
C:A new prohibited test storage deployment is rejected while approved configurations succeed. This would address a different situation, such as: A platform team thinks an Azure Policy Audit effect blocks deployment of unencrypted storage, but noncompliant accounts continue being created. In the present case, the most directly relevant verification is: A deliberately broad assignment fails the CI gate before deployment. The crucial distinction is: IaC static analysis should detect risky patterns before production deployment.
D:A test environment creates approved resources and deprovisions under the policy. This would address a different situation, such as: Developers need consistent temporary test environments, but each manually provisions expensive subscriptions and forgets cleanup. In the present case, the most directly relevant verification is: A deliberately broad assignment fails the CI gate before deployment. The crucial distinction is: IaC static analysis should detect risky patterns before production deployment.
Question 6
A Microsoft DevOps team is addressing: A payment workflow completes an HTTP health check but fails after users submit the checkout form. Which TWO complementary actions should be taken? Select TWO answers.
- Review process exit codes, PublishTestResults task settings and test XML files.
- Inspect schema migration scripts, live app versions, default values and rollback plans.
- Inspect browser-test steps, authentication dependencies and failure traces.
- Review load profile, Azure Load Testing results, request percentiles and capacity metrics.
- Add guarded end-to-end UI tests for checkout and payment confirmation.
Explanation
Correct Answers
C:Inspect browser-test steps, authentication dependencies and failure traces. This supplies the diagnosis/evidence needed for the scenario. Its complementary step is: Add guarded end-to-end UI tests for checkout and payment confirmation. Together they address: Release validation should test critical business journeys rather than only process liveness.
E:Add guarded end-to-end UI tests for checkout and payment confirmation. This supplies the controlled implementation needed for the scenario. Its complementary step is: Inspect browser-test steps, authentication dependencies and failure traces. Together they address: Release validation should test critical business journeys rather than only process liveness.
Incorrect Answers
A:Review process exit codes, PublishTestResults task settings and test XML files. This concerns a different DevOps situation: A pipeline script prints a test failure but exits with zero, leaving no test results visible in Azure Pipelines. This case instead requires both a targeted investigation (Inspect browser-test steps, authentication dependencies and failure traces.) and a controlled change (Add guarded end-to-end UI tests for checkout and payment confirmation.).
B:Inspect schema migration scripts, live app versions, default values and rollback plans. This concerns a different DevOps situation: A release adds a non-null column while old and new application versions temporarily operate together. This case instead requires both a targeted investigation (Inspect browser-test steps, authentication dependencies and failure traces.) and a controlled change (Add guarded end-to-end UI tests for checkout and payment confirmation.).
D:Review load profile, Azure Load Testing results, request percentiles and capacity metrics. This concerns a different DevOps situation: An API passes functional tests for one user but violates latency objectives under 1,000 concurrent clients. This case instead requires both a targeted investigation (Inspect browser-test steps, authentication dependencies and failure traces.) and a controlled change (Add guarded end-to-end UI tests for checkout and payment confirmation.).
Question 7
The DevOps team must resolve this situation: A business rule has 100% line coverage, but tests still pass when its comparison operator is reversed. Which engineering action is MOST appropriate?
- Improve boundary-value assertions and use mutation or targeted fault tests as appropriate.
- Add a risk-based container vulnerability scan gate before deployment approval.
- Test expand-and-contract schema changes against concurrent old and new application instances.
- Require accountable acceptance or closure of critical security blockers before promotion.
Explanation
Correct Answer
A:Improve boundary-value assertions and use mutation or targeted fault tests as appropriate. This action addresses the specific failure or requirement and preserves delivery controls. Validation criterion: A deliberately inverted comparison causes a relevant test to fail. Coverage alone does not establish assertion quality or defect-detection strength.
Incorrect Answers
B:Add a risk-based container vulnerability scan gate before deployment approval. 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 engineering action is: Improve boundary-value assertions and use mutation or targeted fault tests as appropriate. The crucial distinction is: Coverage alone does not establish assertion quality or defect-detection strength.
C:Test expand-and-contract schema changes against concurrent old and new application instances. This would address a different situation, such as: A release adds a non-null column while old and new application versions temporarily operate together. In the present case, the most directly relevant engineering action is: Improve boundary-value assertions and use mutation or targeted fault tests as appropriate. The crucial distinction is: Coverage alone does not establish assertion quality or defect-detection strength.
D:Require accountable acceptance or closure of critical security blockers before promotion. 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 engineering action is: Improve boundary-value assertions and use mutation or targeted fault tests as appropriate. The crucial distinction is: Coverage alone does not establish assertion quality or defect-detection strength.
Question 8
An Azure DevOps engineering team evaluates this condition: An Azure Pipeline fails only on hosted agents because tests require an uninstalled legacy .NET SDK. Which DevOps principle BEST explains the underlying weakness?
- Code-scanning feedback should be available on proposed changes before merge.
- Test environments must provision declared toolchains rather than depend on developer machines.
- Load tests should measure realistic concurrency against explicit performance thresholds.
- Testing pipelines must avoid exposing credentials while preserving useful diagnostics.
Explanation
Correct Answer
B:Test environments must provision declared toolchains rather than depend on developer machines. This principle identifies the risk or delivery weakness in the case. Relevant evidence: Inspect global.json, agent image capabilities, use-dotnet steps and restore failures. An appropriate controlled response is: Install or select the approved SDK version in the pipeline before test execution.
Incorrect Answers
A:Code-scanning feedback should be available on proposed changes before merge. 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 principle is: Test environments must provision declared toolchains rather than depend on developer machines. The crucial distinction is: Test environments must provision declared toolchains rather than depend on developer machines.
C:Load tests should measure realistic concurrency against explicit performance thresholds. This would address a different situation, such as: An API passes functional tests for one user but violates latency objectives under 1,000 concurrent clients. In the present case, the most directly relevant principle is: Test environments must provision declared toolchains rather than depend on developer machines. The crucial distinction is: Test environments must provision declared toolchains rather than depend on developer machines.
D:Testing pipelines must avoid exposing credentials while preserving useful diagnostics. This would address a different situation, such as: A test task writes its service principal secret into verbose logs on every failing run. In the present case, the most directly relevant principle is: Test environments must provision declared toolchains rather than depend on developer machines. The crucial distinction is: Test environments must provision declared toolchains rather than depend on developer machines.
Question 9
Before changing the pipeline or service, engineers find: Every developer can delete the versions of a private production library that other teams depend on. Which evidence should the engineer inspect FIRST?
- Inspect package-lock metadata, dependency tree, registry provenance and update policy.
- Inspect feed role assignments, delete permissions, package history and retention.
- Inspect package visibility, repository grant, GITHUB_TOKEN permissions and workflow context.
- Review API surface change, dependency constraints, version bump rules and changelog.
Explanation
Correct Answer
B:Inspect feed role assignments, delete permissions, package history and retention. This directly checks the uncertain behavior or control before changing production. Package feed roles should separate consumer, publisher and administrative permissions. The resulting targeted action is: Grant read, publish and administration only to the appropriate separate identities.
Incorrect Answers
A:Inspect package-lock metadata, dependency tree, registry provenance and update policy. This would address a different situation, such as: A Node application pins a top-level package but a transitive dependency introduces an unreviewed major behavior change. In the present case, the most directly relevant evidence is: Inspect feed role assignments, delete permissions, package history and retention. The crucial distinction is: Package feed roles should separate consumer, publisher and administrative permissions.
C:Inspect package visibility, repository grant, GITHUB_TOKEN permissions and workflow context. This would address a different situation, such as: A GitHub Actions workflow receives 403 when installing a private package owned by another organization repository. In the present case, the most directly relevant evidence is: Inspect feed role assignments, delete permissions, package history and retention. The crucial distinction is: Package feed roles should separate consumer, publisher and administrative permissions.
D:Review API surface change, dependency constraints, version bump rules and changelog. This would address a different situation, such as: A compatible optional SDK feature is added, but release automation increments the major version for every change. In the present case, the most directly relevant evidence is: Inspect feed role assignments, delete permissions, package history and retention. The crucial distinction is: Package feed roles should separate consumer, publisher and administrative permissions.
Question 10
After implementing the change, the team verifies: A new AKS container image may affect payments, but the team wants to limit customer exposure during rollout. Which result would BEST demonstrate that the issue is corrected?
- The test cohort receives the new flow while excluded users retain the original flow.
- A sample rollout maintains required ready endpoints with no response interruption.
- Replaying a completed migration does not corrupt or duplicate the schema.
- A faulty canary triggers rollback while most production traffic remains on healthy pods.
Explanation
Correct Answer
D:A faulty canary triggers rollback while most production traffic remains on healthy pods. This measures the actual expected outcome, rather than trusting only a configuration flag. Implemented action: Route a bounded canary share to new pods and expand only after acceptance checks. Canary deployments reduce blast radius by validating a small traffic share first.
Incorrect Answers
A:The test cohort receives the new flow while excluded users retain the original flow. This would address a different situation, such as: A retailer wants to expose a new checkout feature to 5% of customers but its current flag is on or off for everyone. In the present case, the most directly relevant verification is: A faulty canary triggers rollback while most production traffic remains on healthy pods. The crucial distinction is: Canary deployments reduce blast radius by validating a small traffic share first.
B:A sample rollout maintains required ready endpoints with no response interruption. This would address a different situation, such as: An AKS update removes every API pod simultaneously because maxUnavailable equals the full replica count. In the present case, the most directly relevant verification is: A faulty canary triggers rollback while most production traffic remains on healthy pods. The crucial distinction is: Canary deployments reduce blast radius by validating a small traffic share first.
C:Replaying a completed migration does not corrupt or duplicate the schema. This would address a different situation, such as: A release database task retries after a timeout and creates duplicate schema objects, causing subsequent deployments to fail. In the present case, the most directly relevant verification is: A faulty canary triggers rollback while most production traffic remains on healthy pods. The crucial distinction is: Canary deployments reduce blast radius by validating a small traffic share first.