Microsoft

AZ-400 Free Practice Questions — Page 22

Question 216

DRAG DROP - You need to deploy Internet Information Services (IIS) to an Azure virtual machine that runs Windows Server 2019. How should you complete the Desired State Configuration (DSC) configuration script? To answer, drag the appropriate values to the correct locations. 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. Select and Place:

Illustration for AZ-400 question 216
Show Answer
Correct Answer: Configuration WindowsFeature
Explanation:
In PowerShell DSC, a configuration starts with the Configuration keyword, and IIS is installed using the WindowsFeature resource with Ensure='Present' and Name='Web-Server'.

Question 217

Your team uses Azure Pipelines to deploy applications. You need to ensure that when a failure occurs during the build or release process, all the team members are notified by using Microsoft Teams. The solution must minimize development effort. What should you do?

A. Install the Azure Boards app for Teams and configure a subscription to receive notifications in a channel.
B. Use Azure Automation to connect to the Azure DevOps REST API and notify the team members.
C. Use an Azure function to connect to the Azure DevOps REST API and notify the team members.
D. Install the Azure Pipelines app for Teams and configure a subscription to receive notifications in a channel.
Show Answer
Correct Answer: D
Explanation:
The Azure Pipelines app for Microsoft Teams provides native notifications for build and release events, including failures, and can be configured through channel subscriptions. This satisfies the requirement to notify team members with minimal development effort. The Azure Boards app is for work item tracking rather than pipeline notifications, while Azure Automation or Azure Functions using the Azure DevOps REST API would require custom development and more effort.

Question 218

You have an Azure subscription that contains 50 virtual machines. You plan to manage the configuration of the virtual machines by using Azure Automation State Configuration. You need to create the Desired State Configuration (DSC) configuration files. How should you structure the code blocks?

A. Node > Configuration > Resource
B. Configuration > Resource > Node
C. Resource > Configuration > Node
D. Configuration > Node > Resource
Show Answer
Correct Answer: D
Explanation:
In PowerShell Desired State Configuration (DSC), the outermost block is the Configuration block. Inside it are one or more Node blocks that specify the target machines. Within each Node block are one or more Resource blocks that define the desired configuration for that node.

Question 219

You have an on-premises app named App1 that accesses Azure resources by using credentials stored in a configuration file. You plan to upgrade App1 to use an Azure service principal. What is required for App1 to programmatically sign in to Azure Active Directory (Azure AD)?

A. the application ID, a client secret, and the object ID
B. a client secret, the object ID, and the tenant ID
C. the application ID, a client secret, and the tenant ID
D. the application ID, a client secret, and the subscription ID
Show Answer
Correct Answer: C
Explanation:
A service principal authenticating with a client secret requires the application (client) ID, the client secret, and the Azure AD (Microsoft Entra ID) tenant ID. The object ID identifies the service principal object but is not used for authentication, and the subscription ID is unrelated to Azure AD sign-in.

Question 220

You use GitHub for source control of .NET applications. You need to deploy a documentation solution that meets the following requirements: ✑ Documents will be written in Markdown as developers make code changes. ✑ Changes to the documents will trigger the recompilation of a static website. ✑ Users will access the documents from the static website. ✑ Documents will be stored in a GitHub repository. Which two tools can you use to compile the website? Each correct answer presents a complete solution. NOTE: Each correct selection is worth one point.

A. Word Press
B. Jekyll
C. DocFX
D. caret
E. Medium
Show Answer
Correct Answer: B, C
Explanation:
Jekyll and DocFX are both static site generators that compile Markdown into static websites. Jekyll integrates well with GitHub Pages, while DocFX is designed for .NET documentation and can generate static documentation sites from Markdown and .NET source code. WordPress and Medium are publishing platforms, and Caret is a Markdown editor rather than a static site compiler.

Question 221

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 Azure Pipelines to build and test a React.js application. You have a pipeline that has a single job. You discover that installing JavaScript packages from npm takes approximately five minutes each time you run the pipeline. You need to recommend a solution to reduce the pipeline execution time. Solution: You recommend using pipeline artifacts. Does this meet the goal?

A. Yes
B. No
Show Answer
Correct Answer: B
Explanation:
Pipeline artifacts are intended to publish and share files produced by a pipeline between jobs or pipelines. To reduce repeated npm install time across pipeline runs, Azure Pipelines caching should be used to cache dependencies such as the npm package cache. Therefore, recommending pipeline artifacts does not meet the goal.

Question 222

You have an Azure subscription that contains multiple Azure pipelines. You need to deploy a monitoring solution for the pipelines. The solution must meet the following requirements: ✑ Parse logs from multiple sources. ✑ Identify the root cause of issues. What advanced feature of a monitoring tool should you include in the solution?

A. analytics
B. synthetic monitoring
C. directed monitoring
D. Alert Management
Show Answer
Correct Answer: A
Explanation:
Analytics is the advanced monitoring capability that aggregates and parses logs from multiple sources and enables correlation and root cause analysis. Synthetic monitoring simulates user interactions, Alert Management focuses on notifications, and 'directed monitoring' is not the appropriate feature for these requirements.

Question 223

You have a GitHub repository that contains workflows. The workflows contain steps that execute predefined actions. Each action has one or more versions. You need to request the specific version of an action to execute. Which three attributes can you use to identify the version? Each correct answer presents a complete solution. NOTE: Each correct selection is worth one point.

A. the SHA-based hashes
B. the tag
C. the runner
D. the branch
E. the serial
Show Answer
Correct Answer: A, B, D
Explanation:
GitHub Actions versions can be referenced by a commit SHA, a tag, or a branch (Git refs). Runners identify the execution environment, not the action version, and there is no serial attribute for action versioning.

Question 224

You have a project in Azure DevOps. You need to push notifications about pull requests to a Microsoft Teams channel. The solution must minimize development effort. What should you do?

A. Install the Azure Pipelines app for Teams and configure a subscription to receive notifications in the channel.
B. Use Azure Automation to connect to the Azure DevOps REST API and send messages to Teams.
C. Install the Azure Repos app for Teams and configure a subscription to receive notifications in the channel.
D. Use an Azure function to connect to the Azure DevOps REST API and send messages to Teams.
Show Answer
Correct Answer: C
Explanation:
Pull request notifications are a feature of Azure Repos. The Azure Repos app for Microsoft Teams provides built-in subscriptions for repository events, including pull request creation and updates, requiring no custom development. Azure Pipelines is focused on pipeline events, while Azure Automation and Azure Functions would require unnecessary custom integration.

Question 225

You have an Azure subscription named Subscription1 that contains a custom Azure policy named Policy1. Policy1 is an audit policy that monitors naming convention compliance for the resources deployed to Subscription1. You have a pipeline named Pipeline1 in Azure Pipelines. Pipeline1 deploys Azure Resource Manager (ARM) resources to Subscription1. You need to ensure that the resources deployed by Pipeline1 comply with Policy1. What should you add to Pipeline1?

A. a pre-deployment task that runs a security and compliance assessment
B. a post-deployment task that runs a security and compliance assessment
C. an ARM template deployment task to assign Policy1 to Subscription1
D. an ARM template deployment task to deploy Policy1 to Subscription1
Show Answer
Correct Answer: B
Explanation:
Policy1 is already a custom audit policy that monitors naming compliance. The question asks what to add to the pipeline to ensure deployed resources comply. An audit policy does not prevent deployment; it evaluates compliance after resources exist. Therefore, add a post-deployment security and compliance assessment task to check Azure Policy compliance after deployment. Options C and D are unnecessary because the policy already exists, and A is less appropriate for an audit policy that evaluates deployed resources. Sources: https://learn.microsoft.com/en-us/azure/container-registry/container-registry-azure-policy https://azure.microsoft.com/en-ca/products/azure-policy

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