Microsoft

AZ-400 Free Practice Questions — Page 8

Question 34

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 DevOps organization named Contoso and an Azure subscription. The subscription contains an Azure virtual machine scale set named VMSS1 that is configured for autoscaling. You have a project in Azure DevOps named Project1. Project1 is used to build a web app named App1 and deploy App1 to VMSS1. You need to ensure that an email alert is generated whenever VMSS1 scales in or out. Solution: From Azure Monitor, configure the autoscale settings. Does this meet the goal?

A. Yes
B. No
Show Answer
Correct Answer: B
Explanation:
No. Configuring autoscale settings alone does not provide the required email alert. Create an Azure Monitor alert for VMSS1 scale events and attach an action group configured to send email.

Question 35

You have a project in Azure DevOps. You plan to deploy a self-hosted agent by using an unattended configuration script. Which two values should you define in the configuration script? Each correct answer presents part of the solution. NOTE: Each correct selection is worth one point.

A. authorization credentials
B. the project name
C. the deployment group name
D. the organization URL
E. the agent pool name
Show Answer
Correct Answer: A, D
Explanation:
An unattended self-hosted agent configuration must specify the Azure DevOps organization URL and authorization credentials so the agent can connect and register. A project name and deployment group name are not required, and the agent pool can default to the Default pool if not specified.

Question 35

SIMULATION - You need to write a KQL query that will count the number of inbound requests for each source IP address, for any connection made during the last three months of 2021. On Azure Data Explorer by using the following link: https://dataexplorer.azure.corn/clusters/help/databases/SecurityLogs The requests are contained in a table named InboundBrowsing in the SecurityLogs connection. The query must return two columns named NumberOfRequests and SourceIP. Export the query result to C:\Samples.

Show Answer
Correct Answer: InboundBrowsing | extend timestamp = todatetime(timestamp) | where timestamp between (datetime(2021-10-01) .. datetime(2022-01-01)) | summarize NumberOfRequests = count() by SourceIP = src_ip | project NumberOfRequests, SourceIP | export to csv (h@"C:\Samples")
Explanation:
Filter to the last three months of 2021, count requests grouped by source IP, return the required column names, then export the results to the specified folder.

Question 36

You have a GitHub repository. You need to ensure that all changes to code are validated by your company’s security department before the main branch is deployed. Which two actions can you perform? Each correct answer presents a complete solution. NOTE: Each correct selection is worth one point.

A. Require signed commits.
B. Create a branch protection rule for the feature branches.
C. Create a LICENSE file.
D. Create a branch protection rule for the main branch.
E. Create a CODEOWNERS file.
Show Answer
Correct Answer: D, E
Explanation:
Use branch protection on the main branch to require pull requests and approvals before changes can be merged and deployed. Add a CODEOWNERS file assigning the security department as code owners for the relevant paths, then enable required review from code owners via branch protection so their approval is mandatory. Requiring signed commits only verifies commit signatures, not security review, and protecting feature branches alone does not ensure the main branch receives the required validated changes.

Question 36

You have a project in Azure DevOps. You create the following YAML template named Template1.yml. steps: - script: npm install - script: yarn install - script: npm run compile You create the following pipeline named File1.yml. parameters: usersteps: - task: MyTask@1 - script: echo Done You need to ensure that Template1.yaml runs before File1.yml. How should you update File1.yml?

A. parameters: usersteps: extends: template: template1.yml - task: MyTask@1 - script: echo Done
B. template: template1.yml parameters: usersteps: - task: MyTask@1 - script: echo Done
C. extends: template: templatel.yml parameters: usersteps: - task: MyTask@1 - script: echo Done
D. parameters: usersteps: - template: templatel.yml - task: MyTask@1 - script: echo Done
Show Answer
Correct Answer: D
Explanation:
Template1.yml is a steps template. Include it as the first item in the usersteps list so its npm, yarn, and compile steps precede MyTask and echo Done. An `extends` declaration is not appropriate for this steps template. Sources: https://learn.microsoft.com/en-us/azure/devops/pipelines/process/templates?view=azure-devops

Question 37

You need to configure Azure Pipelines to control App2 builds. Which authentication method should you use?

A. Windows NTLM
B. certificate
C. SAML
D. personal access token (PAT)
Show Answer
Correct Answer: D
Explanation:
Use a personal access token (PAT) to authenticate Azure Pipelines with Azure DevOps when controlling App2 builds. A PAT can be scoped to the permissions the integration needs. NTLM, certificates, and SAML are not the appropriate authentication method for this scenario.

Question 38

DRAG DROP - You need to configure authentication for App1. The solution must support the planned changes. Which three actions should you perform in sequence? To answer, move all actions from the list of actions to the answer area and arrange them in the correct order. Select and Place:

Illustration for AZ-400 question 38
Show Answer
Correct Answer: 1. Create an app. 2. Add a secret. 3. Configure the ID and secret for App1.
Explanation:
The app registration provides a service principal. Add a client secret, then configure App1 to authenticate using the application ID and secret.

Question 38

You use GitHub Enterprise for source control repositories. The repositories store C# code. You need to enable CodeQL scanning for the repositories. What should you do?

A. Enable Dependabot security updates.
B. Enable Dependabot alerts.
C. Configure a required GitHub Actions workflow for all the repositories.
D. Push a GitHub Actions workflow to all the repositories.
Show Answer
Correct Answer: D
Explanation:
CodeQL scanning on GitHub Enterprise is enabled by adding a CodeQL GitHub Actions workflow to each repository. The workflow initializes CodeQL, builds the C# project, performs analysis, and uploads results. Dependabot alerts and security updates are for dependency vulnerability management, not static code analysis. A required workflow can enforce execution if available, but it does not itself enable CodeQL unless the workflow exists in the repositories or is otherwise configured; the direct action to enable scanning is to add the CodeQL workflow.

Question 39

You are developing an Azure Pipelines pipeline. You need to configure a check in the pipeline that will query Azure Boards to ensure that there are no active work item issues before the pipeline deploys a build to production. Which type of check should you implement?

A. post-deployment approvals
B. manual validations
C. pre-deployment gates
D. pre-deployment approvals
Show Answer
Correct Answer: C
Explanation:
Pre-deployment gates can automatically query external services such as Azure Boards before a deployment proceeds. They are designed to validate conditions (for example, ensuring there are no active work items or incidents) before deploying to an environment. Pre-deployment approvals require human approval, post-deployment approvals occur after deployment, and manual validations are pipeline tasks for human intervention rather than automated Azure Boards checks.

Question 39

You have an Azure subscription that contains multiple Azure services. You need to send an SMS alert when scheduled maintenance is planned for the Azure services. Which two actions should you perform? Each correct answer presents part of the solution. NOTE: Each correct selection is worth one point.

A. Enable Azure Security Center.
B. Create and configure an Azure Monitor alert rule.
C. Create an Azure Service Health alert.
D. Create and configure an action group.
Show Answer
Correct Answer: C, D
Explanation:
Create an Azure Service Health alert scoped to planned maintenance events, then configure an action group with an SMS notification. The action group sends the SMS when the alert fires.

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