Microsoft

AZ-400 Free Practice Questions — Page 12

Question 114

DRAG DROP - You have a web app named App1 that uses Application Insights in Azure Monitor to store log data. App1 has users in multiple locations. You need to query App1 requests from London and Paris that return a 404 error. The solution must meet the following requirements: • Return the timestamp url, resultCode, and duration fields • Only show requests made during the last hour. 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.

Illustration for AZ-400 question 114
Show Answer
Correct Answer: requests | where timestamp >= ago(1hr) | where resultCode == "404" and (client_City == "London" or client_City == "Paris") | project timestamp, url, resultCode, duration
Explanation:
Filter the requests table to the last hour using timestamp >= ago(1hr), then restrict to 404 responses from London or Paris. Use project to return only the required fields.

Question 115

DRAG DROP - You create a Git repository named Repo1 in Azure Repos. You need to configure Repo1 to meet the following requirements: • Work items must be linked to a pull request. • Pull requests must have a minimum of two reviewers. • Pull requests must complete a code review by using a third-party tool. The solution must minimize administrative effort. Which type of policy should you use for each requirement? To answer, drag the appropriate policy types to the correct requirements. Each type policy 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 115
Show Answer
Correct Answer: Work items must be linked to a pull request: Check-in Pull requests must complete a code review by a third-party tool: Status Pull requests must have a minimum of two reviewers: Branch
Explanation:
Check-in policies enforce work item association. Status policies require external/third-party services to report success before PR completion. Branch policies enforce reviewer requirements such as a minimum number of reviewers.

Question 116

You manage source code control and versioning by using GitHub. A large file is committed to a repository accidentally. You need to reduce the size of the repository. The solution must remove the file from the repository. What should you use?

A. bfg
B. lfs
C. gvfs
D. init
Show Answer
Correct Answer: A
Explanation:
To permanently reduce the repository size by removing an accidentally committed large file, the file must be deleted from the entire Git history. BFG Repo-Cleaner is designed specifically for this purpose and efficiently rewrites history to remove large or unwanted files. Git LFS only manages large files going forward, GVFS is for large-scale repo virtualization, and git init only initializes a repository.

Question 117

You have a 1-TB Azure Repos repository named repo1. You need to clone repo1. The solution must meet the following requirements: • You must be able to search the commit history of the /src directory • The amount of time it takes to clone the repository must be minimized Which command should you run?

A. git clone –-depth-1 [email protected] :v3/org/Project1/repo1
B. git clone –-filter=blob:none [email protected] :v3/org/Project1/repo1
C. git clone [email protected] :v3/org/Project1/repo1
D. git clone –-filter=true:0 [email protected] :v3/org/Project1/repo1
Show Answer
Correct Answer: B
Explanation:
To minimize clone time for a very large (1‑TB) repository while still being able to search commit history, you must avoid downloading file contents (blobs) but keep full commit metadata. `git clone --filter=blob:none` performs a partial clone that fetches all commits and trees but omits blobs until needed. This preserves full history (unlike `--depth=1`) and is much faster than a full clone. Option D is invalid syntax.

Question 119

You manage code by using GitHub. You plan to ensure that all GitHub Actions are validated by a security team. You create a branch protection rule requiring that code changes be reviewed by code owners. You need to create the CODEOWNERS file. Where should you create the file?

A. .github/actions/
B. .github/
C. .git/
D. .github/workflows/
Show Answer
Correct Answer: B
Explanation:
GitHub recognizes a CODEOWNERS file only when it is placed in one of the supported locations: the repository root, the docs/ directory, or the .github/ directory. Among the options provided, .github/ is the valid and correct location.

Question 120

Your company uses Azure DevOps and Microsoft Azure Active Directory (Azure AD), part of Microsoft Entra. Only users who have accounts in Azure AD can access the Azure DevOps environment. You need to ensure that only devices that are connected to the on-premises network can access the Azure DevOps environment. What should you do?

A. Assign the Stakeholder access level to all users.
B. In Azure DevOps, configure Security in Project Settings.
C. In Azure AD, configure conditional access.
D. In Azure AD, configure risky sign-ins.
Show Answer
Correct Answer: C
Explanation:
To restrict Azure DevOps access to devices connected to the on-premises network, you must enforce access conditions at the identity layer. Azure AD Conditional Access allows you to create policies based on network location (named locations, IP ranges), device compliance, or hybrid Azure AD–joined status. Azure DevOps relies on Azure AD for authentication, so Conditional Access is the correct way to enforce this requirement. The other options do not control network- or device-based access.

Question 121

DRAG DROP - You have an Azure Repos repository that contains large PSD files. You need to configure Git LFS to manage all the files. 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 121
Show Answer
Correct Answer: git lfs track "*.psd" git add .gitattributes git commit -m "track *.psd files using Git LFS" git lfs migrate import --include="*.psd" --everything git push
Explanation:
Install Git LFS, configure tracking for .psd files, commit the generated .gitattributes, migrate existing history so all PSDs are stored in LFS, then push to the remote repository.

Question 122

You have a project in Azure DevOps named Project1 that references an Azure Artifacts feed named Feed1. You have a package named Package1 that has the versions shown in the following table. You need to perform a build of Project1. Which version of Package1 will be used?

A. 1.0.3
B. 1.4.0
C. 2.0.0
D. 2.3.1
Show Answer
Correct Answer: B
Explanation:
Azure Artifacts resolves packages by feed search order, not purely by highest version. When a feed has both packages published directly to the feed and packages saved from upstream sources, packages published directly to the feed take precedence. In this scenario, version 1.4.0 is the latest version that was published directly to Feed1, whereas higher versions (such as 2.0.0 and 2.3.1) were saved from upstream. Therefore, the build of Project1 will use version 1.4.0.

Question 123

You are automating the testing process for your company. You need to automate UI testing of a web application. Which framework should you use?

A. JaCoco
B. Playwright
C. Xamarin.UITest
D. Microsoft.CodeAnalysis
Show Answer
Correct Answer: B
Explanation:
Playwright is a framework specifically designed for automating UI testing of web applications across multiple modern browsers. The other options serve different purposes: JaCoco is for Java code coverage, Xamarin.UITest targets mobile apps, and Microsoft.CodeAnalysis is for static code analysis rather than UI automation.

Question 124

You have an app named App1 that you release by using Azure Pipelines. App1 has the versions shown in the following table. You complete a code change to fix a bug that was introduced in version 3.4.3. Which version number should you assign to the release?

A. 3.4.4
B. 3.4.8
C. 3.5.0
D. 4.0.1
Show Answer
Correct Answer: D
Explanation:
Using semantic versioning, you always increment from the current released version, not from the version where the bug was introduced. The current release is 4.0.0, and the change is a bug fix with no breaking changes, so the patch number is incremented to 4.0.1.

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