Microsoft

AZ-400 Free Practice Questions — Page 5

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

You create an alert rule in Azure Monitor as shown in the following exhibit. Which action will trigger an alert?

Illustration for AZ-400 question 17
A. a failed attempt to delete the ASP-9bb7 resource
B. a change to a role assignment for the ASP-9bb7 resource
C. a successful attempt to delete the ASP-9bb7 resource
D. a failed attempt to scale up the ASP-9bb7 resource
Show Answer
Correct Answer: A
Explanation:
The rule monitors the ASP-9bb7 resource for failed Administrative activity-log events. A failed attempt to delete that resource matches those conditions.

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 17

DRAG DROP - You plan to use Azure DevOps in development processes. You identify the following issues with the existing development processes: • Frequent discovery of bugs in production • Increasing detection of bugs by customers • Slow resolution of bugs and slow resumption of production You need to implement Key Performance Indicators (KPIs) to track each issue. Which KPI should you implement for each issue? To answer, drag the appropriate KPIs to the correct issues. Each KPI 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 17
Show Answer
Correct Answer: Frequent discovery of bugs in production: Defect escape rate Increasing detection of bugs by customers: Bug report rates Slow resolution of bugs and slow resumption of production: Application failure rates
Explanation:
Defect escape rate tracks bugs that reach production, while bug report rates track reported bugs. Application failure rates reflect the ongoing impact of bugs while production is not fully restored.

Question 18

You have the following Azure policy. You assign the policy to the Tenant root group. What is the effect of the policy?

Illustration for AZ-400 question 18
A. prevents all HTTP traffic to existing Azure Storage accounts
B. ensures that all traffic to new Azure Storage accounts is encrypted
C. prevents HTTPS traffic to new Azure Storage accounts when the accounts are accessed over the Internet
D. ensures that all data for new Azure Storage accounts is encrypted at rest
Show Answer
Correct Answer: B
Explanation:
The policy denies creation or modification of a storage account unless `supportsHttpsTrafficOnly` is `true`, requiring HTTPS-only access for new accounts. It does not configure encryption at rest or automatically affect existing accounts.

Question 18

DRAG DROP - You use an Azure pipeline to build a .NET app that has NuGet dependencies. You need to ensure that the pipeline caches required NuGet packages. How should you configure the pipeline? 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 18
Show Answer
Correct Answer: Key: $(Build.SourcesDirectory)/**/packages.lock.json Restore key: $(Agent.OS) Path: $(NUGET_PACKAGES)
Explanation:
The key includes the lock-file hash so the cache changes when dependencies change. The OS-specific restore key provides a fallback, and the path identifies the NuGet package directory to cache.

Question 19

HOTSPOT - You have an Azure subscription that contains Azure DevOps build pipelines. You need to implement pipeline caching by using the cache task. How should you complete the YAML definition? To answer, select the appropriate options in the answer area. NOTE: Each correct selection is worth one point.

Illustration for AZ-400 question 19
Show Answer
Correct Answer: First dropdown: key: Second dropdown: path:
Explanation:
The cache key identifies the Yarn cache using the OS and lockfile; the path specifies the directory to cache.

Question 19

You plan to create an image that will contain a .NET Core application. You have a Dockerfile file that contains the following code. (Line numbers are included for reference only.) You need to ensure that the image is as small as possible when the image is built. Which line should you modify in the file?

Illustration for AZ-400 question 19
A. 1
B. 3
C. 4
D. 7
Show Answer
Correct Answer: C
Explanation:
Line 4 starts the final build stage, so it should use a .NET runtime image rather than the larger SDK image. The SDK remains in the build stage (line 1) to publish the application; the final image then contains the runtime and published output only.

Question 20

You have an Azure subscription that contains a Log Analytics workspace named WS1 and a virtual machine named VM1. You need to install the Microsoft Enterprise Cloud Monitoring extension on VM1. Which two values are required to configure the extension? Each correct answer presents part of the solution. NOTE: Each correct answer is worth one point.

A. the secret key of WS1
B. the ID of the subscription
C. the system-assigned managed identity of VM1
D. the ID of WS1
E. the resource ID of VM1
Show Answer
Correct Answer: A, D
Explanation:
The Microsoft Enterprise Cloud Monitoring (Log Analytics/OMS) extension is configured with the Log Analytics workspace ID and its shared key (secret key) so the VM can connect to the workspace.

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