Microsoft

AZ-400 Free Practice Questions — Page 9

Question 82

You manage code by using GitHub. You plan to use Dependabot to scan for code dependencies. You need to identify when scanning will be triggered automatically. Which two actions will trigger a scan? Each correct answer presents a complete solution. NOTE: Each correct solution is worth one point.

A. The dependency graph of a repository changes.
B. A pull request is created.
C. A branch is forked.
D. Any commit is pushed.
E. A new advisory is added.
Show Answer
Correct Answer: A, E
Explanation:
Dependabot automatically scans when the repository’s dependency graph changes, such as when dependencies are added, removed, or updated. It also re-evaluates repositories when a new security advisory is added to the GitHub Advisory Database to detect newly disclosed vulnerabilities in existing dependencies.

Question 83

DRAG DROP - You have a tenant in Microsoft Azure Active Directory (Azure AD), part of Microsoft Entra. The tenant contains three groups named Group1, Group2, and Group3. You create a new project in Azure DevOps named Project1. You need to secure the service connections for Project1. The solution must meet the following requirements: • The members of Group1 must be able to share and unshare a service connection with other projects. • The members of Group2 must be able to rename a service connection and update the description. • The members of Group3 must be able to use the service connection within build or release pipelines. • The principle of least privilege must be followed. Which permission should you grant to each group? To answer, drag the appropriate permissions to the correct groups. Each permission may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content. NOTE: Each correct selection is worth one point.

Illustration for AZ-400 question 83
Show Answer
Correct Answer: Group1: Organization-level Administrator Group2: Creator Group3: User
Explanation:
Sharing and unsharing a service connection across projects requires organization-level permissions. Renaming a service connection and updating its description can be done by a Creator without broader administrative rights. Using a service connection in build or release pipelines only requires User permission, satisfying least privilege.

Question 84

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 have an Azure pipeline that is used to deploy a web app. The pipeline includes a test suite named TestSuite1. TestSuite1 is used to validate the operations of the web app. TestSuite1 fails intermittently. You identify that the failures are unrelated to changes in the source code and execution environment. You need to minimize troubleshooting effort for the TestSuite1 failures. Solution: You increase code coverage. Does this meet the goal?

A. Yes
B. No
Show Answer
Correct Answer: B
Explanation:
Increasing code coverage adds more tests but does not address intermittent, flaky test failures that are unrelated to source code or environment changes. Such failures are typically caused by timing issues, unstable dependencies, or poor test design. Increasing coverage would not reduce troubleshooting effort for these failures.

Question 86

HOTSPOT - You have a GitHub repository. You plan to use the repository to create a container. You need to configure GitHub Actions to deploy the container to GitHub Container Registry. 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 86
Show Answer
Correct Answer: Step 1: echo $GITHUB_TOKEN | docker login ghcr.io -u USERNAME --password-stdin Step 2: docker build --file Dockerfile --tag ${{ github.repository }}:latest --label "runnumber=${{ github.run_number }}" Step 3: docker push ghcr.io/${{ github.repository_owner }}/${{ github.repository }}:latest
Explanation:
To deploy a container to GitHub Container Registry, the workflow must authenticate to ghcr.io using the GITHUB_TOKEN, then build the Docker image locally, and finally push the image to the registry. Login is only required for registry operations, while build can occur independently.

Question 87

You plan to publish build artifacts by using an Azure pipeline. You need to create an .artifactignore file that meets the following requirements: • Includes all files in the build output folder and all subfolders • Excludes files that have the .dll extension What should you include in the file?

A. ./** !*.dll
B. **/* !*.dll
C. */** *.dll
D. **/* #*.dll
Show Answer
Correct Answer: B
Explanation:
.artifactignore follows gitignore-style rules. `**/*` matches all files in the build output folder and all subfolders. Prefixing a pattern with `!` negates it, meaning those files are not ignored. Therefore `!*.dll` re-includes DLL files so everything else is ignored. This satisfies including all files while excluding `.dll` files from being ignored (so they are published).

Question 88

You have an app named App1 that is built by using Azure Pipelines. The source code for App1 is stored in Azure Repos and contains open source libraries. You need to identify security vulnerabilities in the open source code. What should you use?

A. Mend Bolt
B. Rollbar
C. Code Climate
D. DeepSource
Show Answer
Correct Answer: A
Explanation:
Mend Bolt (formerly WhiteSource Bolt) integrates with Azure DevOps/Azure Pipelines to scan open source dependencies in Azure Repos, identifying known security vulnerabilities and license issues. The other options focus on runtime error tracking or general code quality rather than open source vulnerability scanning.

Question 89

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 have an Azure pipeline that is used to deploy a web app. The pipeline includes a test suite named TestSuite1. TestSuite1 is used to validate the operations of the web app. TestSuite1 fails intermittently. You identify that the failures are unrelated to changes in the source code and execution environment. You need to minimize troubleshooting effort for the TestSuite1 failures. Solution: You enable Test Impact Analysis (TIA). Does this meet the goal?

A. Yes
B. No
Show Answer
Correct Answer: B
Explanation:
Test Impact Analysis optimizes which tests run based on code changes; it does not address flaky or intermittent test failures. Since TestSuite1 fails intermittently for reasons unrelated to code or environment changes, enabling TIA would not minimize troubleshooting effort for those failures.

Question 90

You plan to use Azure DevOps to build and deploy an app that will be hosted in a Kubernetes cluster. You need to scan the app image for vulnerabilities before the image is deployed to the cluster. What should you include in the solution?

A. Microsoft Defender for Containers
B. Microsoft Defender for App Service
C. Microsoft Defender for DevOps
D. Microsoft Defender for Storage
Show Answer
Correct Answer: A
Explanation:
You must scan a container image for vulnerabilities before it is deployed to a Kubernetes cluster. Microsoft Defender for Containers includes container image vulnerability scanning (using tools such as Trivy) as part of Defender for Cloud, and is specifically designed to secure container images and Kubernetes workloads. The other options target different resources (App Service, DevOps pipelines, or Storage) and do not directly provide Kubernetes container image vulnerability scanning for deployment.

Question 91

DRAG DROP - You are using Agile process methodologies and Azure Boards in Azure DevOps. You import the work items shown in the following table. You need to categorize the items. Which state should you assign to each item? To answer, drag the appropriate states to the correct items. Each state may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content. NOTE: Each correct selection is worth one point.

Illustration for AZ-400 question 91 Illustration for AZ-400 question 91
Show Answer
Correct Answer: Item1: Resolved Item2: Proposed Item3: Completed
Explanation:
In the Agile process, **Resolved** is used when work is implemented but not yet verified and still appears on the backlog. **Proposed** represents work that has not started and appears on the backlog. **Completed** indicates finished work that no longer appears on the backlog but can still appear on the board.

Question 92

You have the services shown in the following table. You manage a project by using Azure Boards. You need to notify the services of build status changes. Which services can be notified by using a webhook?

A. Service1 only
B. Service2 only
C. Service1 and Service2
Show Answer
Correct Answer: C
Explanation:
Azure DevOps service hooks support generic webhooks that can send HTTP POST notifications to both HTTP and HTTPS endpoints. Since both Service1 and Service2 meet the webhook endpoint requirements shown in the table, they can both be notified of build status changes using a webhook.

$19

Get all 531 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.