Microsoft

AZ-400 Free Practice Questions — Page 2

Question 11

Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution. After you answer a question in this section, you will NOT be able to return to it As a result these questions will not appear in the review screen. You need to use an Azure Pipelines pipeline to build and test an app and test the database of the app. The solution must meet the following requirements. • The test stages must be run in parallel. • The Publish_Test_Results stage must always be run. • The test stages must be run after successful completion of the build stage. • The Publish_Test_Results stage must be run after completion of all the test stages. Solution: You include the following elements in the YAML definition of the pipeline. Does this meet the goal?

A. Yes
B. No
Show Answer
Correct Answer: B
Explanation:
No. To meet the requirements, the build stage must complete successfully before the test stages, the test stages must run in parallel, and the Publish_Test_Results stage must depend on all test stages and use `condition: always()` so it runs regardless of test success or failure after all tests complete.

Question 12

SIMULATION - Initialize the default main branch, if it does not exist already. In the User1-12345678 organization, you need to install the Microsoft Security DevOps extension. Next, create a new starter pipeline named starter1 that will use the following starter code. Ensure that starter1 includes a task that executes the extension and uses the following inputs: • Command: run • Policy: azuredevops • Publish: true Save the pipeline to a new branch named starter.

Illustration for AZ-400 question 12
Show Answer
Correct Answer: Initialize default main branch if needed. Install Microsoft Security DevOps extension in the User1-12345678 Azure DevOps organization. Create starter pipeline 'starter1' using the provided starter YAML. Add task: - task: MicrosoftSecurityDevOps@1 inputs: command: 'run' policy: 'azuredevops' publish: true Save the pipeline to a new branch named 'starter'.
Explanation:
The required task is the Microsoft Security DevOps pipeline task configured with command=run, policy=azuredevops, and publish=true, then save the new pipeline on the starter branch.

Question 13

HOTSPOT - You have a GitHub repository named Repo1 and an app named App1. Repo1 stores the source code for App1. You need to perform the following tests: • Test1: Run a ZAP spider against App1 for one minute and wait for passive scanning to complete. The test must NOT perform active attacks. • Test2: Run a ZAP spider against App1, and when complete, execute an AJAX spider scan. Which GitHub action should you use for each test? To answer, select the appropriate options in the answer area. NOTE: Each correct selection is worth one point.

Illustration for AZ-400 question 13
Show Answer
Correct Answer: Test1: ZAP Baseline Scan Test2: ZAP Full Scan
Explanation:
Baseline Scan performs a traditional spider for a configurable time (such as one minute), waits for passive scanning to finish, and does not perform active attacks. Full Scan runs the spider and can then perform additional crawling such as the AJAX spider before active scanning, matching the described workflow better than API Scan.

Question 14

You have a GitHub repository that uses GitHub Actions and stores access keys by using GitHub encrypted secrets. You plan to update the secrets by using the GitHub REST API. You need to wrap the secrets before adding them to a REST-based call. Which encryption library should you use?

A. CryptoNet
B. BouncyCastle
C. libsodium
D. hashlib
Show Answer
Correct Answer: C
Explanation:
GitHub's REST API for Actions secrets requires clients to encrypt secret values using the repository or organization public key with the libsodium sealed box construction before uploading. Therefore, the correct encryption library is libsodium.

Question 15

HOTSPOT - You have an Azure DevOps project that is used to build and test an app named App1. You need to troubleshoot the following issues: • Most bugs are detected and reported by customers. • It takes a long time to detect failures. Which metric should you review for each issue? To answer, select the appropriate options in the answer area. NOTE: Each correct selection is worth one point.

Illustration for AZ-400 question 15
Show Answer
Correct Answer: Most bugs being detected and reported by customers: Defect escape rate It takes a long time to detect failures: Mean time to detection
Explanation:
Defect escape rate measures defects that escape testing and are found by customers. Mean time to detection (MTTD) measures how long it takes to detect failures after they occur.

Question 16

You manage a project by using Azure Boards, and you manage the project code by using GitHub repositories. You have a work item that has an ID of 123. You need to link a commit message in GitHub to work item 123 on the board. What are two ways to achieve the goal? Each correct answer presents a complete solution. NOTE: Each correct selection is worth one point.

A. From the Development settings of work item 123, select Add link, and then enter the URL of the commit.
B. Add AB#123 to the text of the commit message.
C. Add GH-123 to the text of the commit message.
D. From the Links settings of work item 123, select Add link, select Existing item, and then enter the URL of the commit.
E. To work item 123, add a comment that includes the URL of the commit.
Show Answer
Correct Answer: A, B
Explanation:
Using `AB#123` in a GitHub commit message automatically links the commit to Azure Boards work item 123 when the GitHub-Azure Boards integration is configured. Alternatively, from the work item's Development section you can use Add link to associate a GitHub commit (including pasting the commit URL when needed). The Links section is intended for generic artifact links rather than the dedicated development linkage.

Question 17

HOTSPOT - You have an Azure subscription that contains multiple web apps. You need to enable Change Analysis for the web apps. How should you complete the script? To answer, select the appropriate options in the answer area. NOTE: Each correct selection is worth one point.

Illustration for AZ-400 question 17
Show Answer
Correct Answer: Register-AzResourceProvider -ProviderNamespace Set-AzResource -ResourceId
Explanation:
Enable the Microsoft.ChangeAnalysis resource provider first, then update each web app by setting the required hidden tag using Set-AzResource with the resource ID.

Question 18

Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution. After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen. You use an Azure Pipelines pipeline to build and release web apps. You need to configure the pipeline to meet the following requirements: • Only run when there is a change in the /webapp folder. • Only run when a pr is created. Solution: You configure the pipeline definition by using the following elements. Does this meet the goal?

A. Yes
B. No
Show Answer
Correct Answer: B
Explanation:
The proposed pipeline configuration does not meet the stated goals. To run only for pull requests affecting the /webapp folder, PR triggering must be configured at the top level with the path filter under `pr.paths.include` (and CI triggers disabled if only PRs should run). A configuration with `branches` and `paths` misplaced or swapped will not satisfy the requirements.

Question 20

Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution. After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen. You use an Azure Pipelines pipeline to build and release web apps. You need to configure the pipeline to meet the following requirements: • Only run when there is a change in the /webapp folder. • Only run when a pr is created. Solution: You configure the pipeline definition by using the following elements. Does this meet the goal?

A. Yes
B. No
Show Answer
Correct Answer: B
Explanation:
The stated goal requires the pipeline to run only for pull requests and only when changes affect the /webapp folder. A configuration that uses a CI trigger (`trigger`) instead of relying solely on a `pr` trigger would not meet the requirement because it would also run on pushes. The correct approach is to use a `pr` trigger with an appropriate `paths` include filter and disable CI triggers if necessary.

Question 21

DRAG DROP - You have a GitHub repository named repo1 and an Azure key vault named kv1. In repo1, you plan to create a workflow named Workflow1 that will deploy a database server by using credentials stored in kv1. You need to ensure that Workflow1 can retrieve the credentials from kv1. Which three actions should you perform in sequence? To answer, move the appropriate actions from the list of actions to the answer area and arrange them in the correct order. NOTE: More than one order of answer choices is correct. You will receive credit for any of the correct orders you select.

Illustration for AZ-400 question 21
Show Answer
Correct Answer: Create a service principal in Microsoft Entra ID. Grant secret permissions to kv1. Reference the credentials in Workflow1.
Explanation:
GitHub Actions authenticates to Azure using a service principal. That identity must have secret access to the Azure Key Vault, and then the workflow can reference the retrieved secrets during deployment.

$19

Get all 534 questions with detailed answers and explanations

  • Instant download HTML + PDF delivered the moment payment clears.
  • Secure Stripe checkout we never see or store your card details.
  • 7-day refund if files are defective see our refund policy.