Microsoft

AZ-400 Free Practice Questions — Page 14

Question 133

DRAG DROP - You have an Azure Repos repository named repo1. You need to clone repo1. The solution must clone only a directory named src/web. How should you complete the script? To answer, drag the appropriate values to the correct targets. Each value 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 133
Show Answer
Correct Answer: scalar clone https://dev.azure.com/organization/project/_git/repo1 cd repo1/src git sparse-checkout set src/web
Explanation:
Use the Azure DevOps HTTPS repository URL with Scalar. Scalar clones into a directory containing a src folder, so change to repo1/src, then configure sparse checkout for the repository path src/web.

Question 134

You have a GitHub repository that contains multiple workflows and a secret stored at the environment level. You need to ensure that the secret can be used by all the workflows. What should you do first?

A. Recreate the secret at the organization level.
B. Recreate the secret at the repository level.
C. Enable required reviewers.
Show Answer
Correct Answer: B
Explanation:
Environment secrets are scoped to a specific environment and are only available to jobs that reference that environment. If the goal is for all workflows in a single repository to use the secret without being tied to a specific environment, the first step is to recreate it as a repository secret. Organization secrets are intended for sharing across multiple repositories, which is not required by the question. Required reviewers only control approval for environment access and do not broaden secret scope.

Question 136

You are creating a dashboard in Azure Boards. You need to visualize the time from when work starts on a work item until the work item is closed. Which type of widget should you use?

A. cycle time
B. velocity
C. cumulative flow
D. lead time
Show Answer
Correct Answer: A
Explanation:
Cycle time measures the time from when work begins on a work item until it is completed/closed. Lead time measures from work item creation to completion. Velocity tracks delivered work across iterations, and cumulative flow visualizes work-in-progress and flow state trends.

Question 137

You manage a project by using Azure Boards. You manage the project code by using GitHub. You have three work items that have IDs of 456, 457, and 458. You need to create a pull request that will be linked to all the work items. The solution must set the state of work item 456 to done. What should you add to the commit message?

A. Fixes #456, #457, #458
B. Fixes #AB456, #AB457, #AB458
C. #456, #457, #458 Completed #456
D. #AB456, #AB457, #AB458
Show Answer
Correct Answer: B
Explanation:
When referencing Azure Boards work items from GitHub, use the AB#ID syntax. The 'Fixes' keyword both links the work items and transitions only the first referenced work item to the completed/resolved state category. Thus 'Fixes AB#456, AB#457, AB#458' is the intended syntax; among the provided options, B best matches this intent (despite the option's formatting showing '#AB' instead of the documented 'AB#').

Question 138

You have a GitHub repository that is integrated with Azure Boards. Azure Boards has a work item that has the number 715. You need to ensure that when you commit source code in GitHub, the work item is updated automatically. What should you include in the commit comments?

A. the URL of the work item
B. AB#715
C. @715
D. #715
Show Answer
Correct Answer: B
Explanation:
For GitHub repositories integrated with Azure Boards, include the Azure Boards work item reference in the commit message using the format AB#<work item ID>. Using 'AB#715' links the commit to work item 715 and updates it automatically according to Azure Boards integration behavior.

Question 139

HOTSPOT - You have an Azure virtual machine named web1. You need to query the amount of free memory that was available on web1 during the past seven days. The solution must meet the following requirements: • Display the data as a time chart. • Calculate the average value per hour. How should you complete the KQL query? To answer, select the appropriate options in the answer area. NOTE: Each correct selection is worth one point.

Illustration for AZ-400 question 139
Show Answer
Correct Answer: TimeGenerated > ago(7d) bin(TimeGenerated, 1h)
Explanation:
Filter to records from the last seven days, group timestamps into 1-hour bins to calculate the hourly average with summarize avg(CounterValue), and render as a timechart.

Question 140

You use Azure Pipelines to build and deploy an app named App1. You plan to monitor App1 by using Application Insights. You create an Application Insights instance named AI1. You need to configure App1 to use AI1. Which file should you modify?

A. appsettings.json
B. launchSettings.json
C. startup.cs
D. project.json
Show Answer
Correct Answer: A
Explanation:
To configure an application to use a specific Application Insights resource (AI1), you typically provide the Application Insights connection string or instrumentation key through application configuration, commonly in appsettings.json. Startup.cs wires up Application Insights services, but the resource-specific configuration belongs in application settings. launchSettings.json is for local launch profiles, and project.json is obsolete.

Question 141

DRAG DROP - You have a web app named App1 that uses Application Insights in Azure Monitor. You need to compare the hourly CPU usage of App1 from the last 24 hours. The solution must include a graph that has a threshold line at 75 percent. How should you complete the query? To answer, drag the appropriate values to the correct targets. Each value 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 141
Show Answer
Correct Answer: bin(TimeGenerated, 1h) extend
Explanation:
Use hourly time bins in the summarize clause to compare CPU usage over the last 24 hours. Then use extend to add a constant Threshold = 75 column for plotting the threshold line.

Question 142

You have a project in Azure DevOps named Project1. Project1 contains a build pipeline named Pipe1 that builds an application named App1. You have an agent pool named Pool1 that contains a Windows Server 2022-based self-hosted agent. Pipe1 uses Pool1. You plan to implement another project named Project2. Project2 will have a build pipeline named Pipe2 that builds an application named App2. App1 and App2 have conflicting dependencies. You need to minimize the possibility that the two build pipelines will conflict with each other. The solution must minimize infrastructure costs. What should you do?

A. Add another self-hosted agent.
B. Add a Docker Compose task to the build pipelines.
C. Change the self-hosted agent to use Red Hat Enterprise Linux (RHEL) 9.
D. Create two container jobs.
Show Answer
Correct Answer: D
Explanation:
Use two container jobs so each pipeline runs in its own isolated container environment. This prevents dependency conflicts between App1 and App2 while continuing to use the same self-hosted agent, minimizing infrastructure costs. Adding another self-hosted agent increases infrastructure cost, Docker Compose is for orchestrating multiple containers rather than isolating the build job itself, and changing the agent OS does not resolve conflicting application build dependencies.

Question 143

You have a public GitHub repository named Public1. A commit is made to Public1. The commit contains a pattern that matches a regular expression. Who is notified first when the commit is made?

A. the administrator of the GitHub organization
B. the committer
C. the owner of Public1
D. the secret scanning partner
Show Answer
Correct Answer: D
Explanation:
For public repositories, GitHub secret scanning for partners detects supported secret patterns and notifies the relevant secret scanning partner immediately so the credential can be revoked or protected. User/organization alerts are a separate feature and are not the first notification in this scenario.

$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.