Microsoft

AZ-400 Free Practice Questions — Page 15

Question 144

You manage code by using GitHub. You need to ensure that repository owners are notified if a new vulnerable dependency or malware is found in their repository. What should you do?

A. Configure CodeQL scanning actions.
B. Configure Dependabot alerts.
C. Configure branch protection rules for each repository.
D. Subscribe all the repository owners to the GitHub Advisory Database.
Show Answer
Correct Answer: B
Explanation:
Dependabot alerts notify repository owners and administrators when GitHub detects vulnerable dependencies or malware affecting a repository's dependencies. CodeQL analyzes code for security issues but is not the feature that provides dependency vulnerability notifications. Branch protection rules are unrelated, and subscribing to the GitHub Advisory Database does not provide repository-specific alerts.

Question 145

You have an Azure subscription that contains four Azure virtual machines. You need to configure the virtual machines to use a single identity. The solution must meet the following requirements: • Ensure that the credentials for the identity are managed automatically. • Support granting privileges to the identity. Which type of identity should you use?

A. a system-assigned managed identity
B. a user-assigned managed identity
C. a service principal
D. a user account
Show Answer
Correct Answer: B
Explanation:
A user-assigned managed identity is the correct choice because it can be attached to multiple Azure virtual machines, providing a single shared identity. Managed identities have automatically managed credentials, and the identity can be granted Azure RBAC permissions or access to supported resources. A system-assigned managed identity is unique to a single resource and cannot be shared across multiple VMs.

Question 146

DRAG DROP - You have a GitHub repository named repo1. You migrate repo1 to an Azure Repos repository named repo2. After the migration, changes are made to repo1. You need to sync the changes to repo2. 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 146
Show Answer
Correct Answer: repo2 clone URL repo2 repo1 repo URL
Explanation:
To sync later changes, clone the Azure Repos destination (repo2), change into its directory, add the original GitHub repository (repo1) as the upstream mirror source, fetch updates, then push to origin.

Question 147

DRAG DROP - You have a GitHub organization that contains three users named User1, User2, and User3. You have a project that contains a repository named repo1. You need to configure permissions for repo1. The solution must meet the following requirements: • Ensure that User1 can actively push to repo1. • Ensure that User2 can manage issues and pull requests for repo1. • Ensure that User3 can manage repo1. • Prevent User3 from accessing sensitive data in repo1. Which role should you assign to each user? To answer, drag the appropriate roles to the correct users. Each role 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 147
Show Answer
Correct Answer: User1: Write User2: Triage User3: Maintain
Explanation:
Write allows pushing to the repository. Triage manages issues and pull requests without write access. Maintain manages the repository but does not have access to sensitive/destructive administrative settings, unlike Admin.

Question 148

HOTSPOT - You are using Agile process methodologies in Azure DevOps. You need to deploy a dashboard that will provide progress reports for the following work items: • How long it took to close a work item after it was created. • How long it took to close a work item after the work was started. Which type of widget should you use for each work item? To answer, select the appropriate options in the answer area. NOTE: Each correct selection is worth one point.

Illustration for AZ-400 question 148
Show Answer
Correct Answer: How long it took to close a work item after it was created: Lead time How long it took to close a work item after the work was started: Cycle time
Explanation:
Lead time measures elapsed time from work item creation to completion. Cycle time measures elapsed time from when active work begins until completion.

Question 149

You use GitHub for source control and Microsoft Teams for collaboration. You need to send a notification to a Teams channel for each commit. The solution must minimize development effort. What should you do?

A. Use Azure Automation to connect to the GitHub Actions API and send a message to the Teams channel.
B. Use the Microsoft Teams for GitHub app and configure a subscription to receive notifications in the Teams channel.
C. Use GitHub Actions with a dispatch to send a message to the Teams channel by using the Teams API.
D. Use Azure Functions to connect to the GitHub REST API and send a message to the Teams channel.
Show Answer
Correct Answer: B
Explanation:
Use the Microsoft Teams for GitHub app and configure a subscription for the repository/channel. This provides built-in integration that can send commit notifications to a Teams channel with minimal development effort, avoiding custom automation with Azure Functions, Automation, or GitHub Actions.

Question 150

You have an Azure subscription that contains the resources shown in the following table. DepPipeline1 and ADFPipeline1 use a single credential that is stored in Vault1. You need to configure ADFPipeline1 to retrieve the credential from Vault1. Which type of activity should you use?

A. Lookup
B. Get Metadata
C. Сoрy
D. Web
Show Answer
Correct Answer: D
Explanation:
Use a Web activity in Azure Data Factory to call the Azure Key Vault REST API and retrieve a secret during pipeline execution. Lookup, Get Metadata, and Copy activities are not designed to fetch secrets from Key Vault.

Question 151

SIMULATION - You have an Azure function hosted in an App Service plan named az400-123456789-func1. You need to configure az400-123456789-func1 to upgrade the functions automatically whenever new code is committed to the master branch of https:// github.com/Azure-Samples/functions-quickstart. To complete this task, sign in to the Microsoft Azure portal.

Show Answer
Correct Answer: Azure Portal → Function App → Deployment Center Source: External Git Repository: https://github.com/Azure-Samples/functions-quickstart Branch: master Authorize GitHub if prompted and Save.
Explanation:
Configure continuous deployment from the specified GitHub repository and master branch so the Function App automatically deploys new commits.

Question 152

DRAG DROP - You have a GitHub repository named repo1 that stores the code of an app named App1. You need deploy a workflow for repo1 by using GitHub Actions. The solution must meet the following requirements: • Scan on pushes to the main branch. • Scan on pull requests to the main branch. • Scan on pull requests to any branch that has a prefix of releases/. • Scan all the files in the subdirectories of the src directory. • Exclude scanning of markdown files. How should you complete the code? 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 152
Show Answer
Correct Answer: branches: 'releases/**' paths: 'src/**' paths-ignore: '**/*.md'
Explanation:
Use releases/** to match PR branches prefixed with releases/. Use src/** to include all files under src recursively. Use **/*.md to exclude Markdown files recursively.

Question 153

DRAG DROP - You have an Azure DevOps pipeline that is used to deploy a Node.js app. You need to ensure that the dependencies are cached between builds. How should you configure the deployment YAML? 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 153
Show Answer
Correct Answer: npm install ne(variables.CACHE_RESTORED, 'true')
Explanation:
Use the Cache@2 task with cacheHitVar. If the cache is not restored, run npm install to populate the cache; if the cache is restored, skip installation. The build step would run later without this condition.

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