Looking for more? Click here to get the full PDF with 308+ practice questions for $10 for offline study and deeper preparation.
Question 1
You have a project in Azure DevOps named Project1. You implement a Continuous Integration/Continuous Deployment (CI/CD) pipeline that uses PowerShell Desired State Configuration (DSC) to configure the application infrastructure. You need to perform a unit test and an integration test of the configuration before Project1 is deployed. What should you use?
A. the PSScriptAnalyzer tool
B. the Pester test framework
C. the PSCodeHealth module
D. the Test-DscConfiguration cmdlet
Show Answer
Correct Answer:
B. the Pester test framework
Question 2
You plan to use Azure DevOps to build and deploy an app that will be hosted in a Kubernetes cluster. You need to scan the app image for vulnerabilities before the image is deployed to the cluster. What should you include in the solution?
A. Microsoft Defender for Containers
B. Microsoft Defender for App Service
C. Microsoft Defender for DevOps
D. Microsoft Defender for Storage
Show Answer
Correct Answer:
A. Microsoft Defender for Containers
Question 3
You plan to deploy a solution that will include multiple microservices. You need to recommend a deployment strategy for the microservices. The solution must meet the following requirements: • Enable testing and monitoring of changes during a gradual rollout. • Control the number of users that will receive new code releases. Which strategy should you recommend?
A. progressive exposure
B. A/B
C. feature toggle
D. blue/green
Show Answer
Correct Answer:
A. progressive exposure
Question 4
Your company uses the following resources: ✑ Windows Server 2019 container images hosted in an Azure Container Registry. ✑ Azure virtual machines that run the latest version of Ubuntu ✑ An Azure Log Analytics workspace ✑ Azure Active Directory (Azure AD) ✑ An Azure key vault For which two resources can you receive vulnerability assessments in Azure Security Center? Each correct answer presents part of the solution. NOTE: Each correct selection is worth one point.
A. the Azure Log Analytics workspace
B. the Azure key vault
C. the Azure virtual machines that run the latest version of Ubuntu
D. Azure Active Directory (Azure AD)
E. The Windows Server 2019 container images hosted in the Azure Container Registry
Show Answer
Correct Answer:
C. the Azure virtual machines that run the latest version of Ubuntu
E. The Windows Server 2019 container images hosted in the Azure Container Registry
Question 5
You are creating a build pipeline in Azure Pipelines. You define several tests that might fail due to third-party applications. You need to ensure that the build pipeline completes successfully if the third-party applications are unavailable. What should you do?
A. Configure the build pipeline to use parallel jobs
B. Configure flaky tests
C. Increase the test pass percentage
D. Add the Requirements quality widget to your dashboard
Show Answer
Correct Answer:
B. Configure flaky tests
Question 6
You need to the merge the POC branch into the default branch. The solution must meet the technical requirements. Which command should you run?
A. git rebase
B. git merge --squash
C. git push
D. git merge --allow-unrelated-histories
Show Answer
Correct Answer:
A. git rebase
Question 7
You have an Azure subscription that contains a storage account and 20 virtual machines. You plan to use LogRhythm for aggregation and analysis of the virtual machine logs. You need to configure AzLog to export the logs and push them to the storage account. In which format should you export the logs?
A. JSON
B. EVTX
C. EVT
D. binary
Show Answer
Correct Answer:
A. JSON
Question 8
Your company uses Azure DevOps to manage the build and release processes for applications. You use a Git repository for applications source control. You plan to create a new branch from an existing pull request. Later, you plan to merge the new branch and the target branch of the pull request. You need to use a pull request action to create the new branch. The solution must ensure that the branch uses only a portion of the code in the pull request. Which pull request action should you use?
A. Set as default branch
B. Approve with suggestions
C. Cherry-pick
D. Reactivate
E. Revert
Show Answer
Correct Answer:
C. Cherry-pick
Question 9
You are in the process of building a mobile app aimed at Android and iOS devices. All work items and release cycles are managed via Azure DevOps. You want to make sure that crash reports for issue analysis is collected, and that beta releases are distributed to your testers. Also, you want to ensure that user feedback on the functionality of new apps is received. Which of the following must be part of your solution?
A. The Microsoft Test & Feedback extension
B. OWASP ZAP
C. TFS Integration Platform
D. Code Style
Show Answer
Correct Answer:
A. The Microsoft Test & Feedback extension
Question 10
You are deploying a server application that will run on a Server Core installation of Windows Server 2019. You create an Azure key vault and a secret. You need to use the key vault to secure API secrets for third-party integrations. Which three actions should you perform? Each correct answer presents part of the solution. NOTE: Each correct selection is worth one point.
A. Configure RBAC for the key vault
B. Modify the application to access the key vault
C. Configure a Key Vault access policy
D. Deploy an Azure Desired State Configuration (DSC) extension
E. Deploy a virtual machine that uses a system-assigned managed identity
Show Answer
Correct Answer:
A. Configure RBAC for the key vault
B. Modify the application to access the key vault
E. Deploy a virtual machine that uses a system-assigned managed identity
Question 11
You are building a Microsoft ASP.NET application that requires authentication. You need to authenticate users by using Azure Active Directory (Azure AD). What should you do first?
A. Assign an enterprise application to users and groups
B. Create an app registration in Azure AD
C. Configure the application to use a SAML endpoint
D. Create a new OAuth token from the application
E. Create a membership database in an Azure SQL database
Show Answer
Correct Answer:
B. Create an app registration in Azure AD
Question 12
You have a GitHub repository that uses GitHub Actions and stores access keys by using GitHub encrypted secrets. You plan to update the secrets by using the GitHub REST API. You need to wrap the secrets before adding them to a REST-based call. Which encryption library should you use?
A. CryptoNet
B. BouncyCastle
C. libsodium
D. hashlib
Show Answer
Correct Answer:
C. libsodium
Question 13
You store source code in a Git repository in Azure Repos. You use a third-party continuous integration (CI) tool to control builds. What will Azure DevOps use to authenticate with the tool?
A. certificate authentication
B. a personal access token (PAT)
C. a Shared Access Signature (SAS) token
D. NTLM authentication
Show Answer
Correct Answer:
B. a personal access token (PAT)
Question 14
Your company has an Azure DevOps project that produces Node Package Manager (npm) packages. Multiple projects consume the packages. You need to minimize the amount of disk space used by older packages in Azure Artifacts. What should you modify?
A. the retention settings of the project’s release
B. the retention settings of the project’s pipeline
C. the retention settings of the project’s tests
D. the retention settings of the company pipeline
Show Answer
Correct Answer:
B. the retention settings of the project’s pipeline
Question 15
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. the application ID, a client secret, and the tenant ID
Question 16
Your company has a project in Azure DevOps for a new web application. The company identifies security as one of the highest priorities. You need to recommend a solution to minimize the likelihood that infrastructure credentials will be leaked. What should you recommend?
A. Add a Run Inline Azure PowerShell task to the pipeline
B. Add a PowerShell task to the pipeline and run Set-AzureKeyVaultSecret
C. Add an Azure Key Vault task to the pipeline
D. Add Azure Key Vault references to Azure Resource Manger templates
Show Answer
Correct Answer:
C. Add an Azure Key Vault task to the pipeline
Question 17
You manage a project by using Azure Boards. You manage the project code by using GitHub. You have three work items that have IDs of 456, 457, and 458. You need to create a pull request that will be linked to all the work items. The solution must set the state of work item 456 to done. What should you add to the commit message?
A. #AB456, #AB457, #AB458 Completed #AB456
B. #456, #457, #458 Completed #456
C. Done #AB456, #AB457, #AB458
D. #AB456, #AB457, #AB458 Verifies #AB456
Show Answer
Correct Answer:
A. #AB456, #AB457, #AB458 Completed #AB456
Question 18
You have an existing project in Azure DevOps. You plan to integrate GitHub as the repository for the project. You need to ensure that Azure Pipelines runs under the Azure Pipelines identity. Which authentication mechanism should you use?
A. personal access token (PAT)
B. GitHub App
C. Azure Active Directory (Azure AD)
D. OAuth
Show Answer
Correct Answer:
B. GitHub App
Question 19
You build an iOS app. You receive crash reports from Crashlytics. You need to capture the following data: ✑ Crash-free users ✑ Custom events ✑ Breadcrumbs What should you do?
A. Configure the xcworkspace file in the project
B. Add the GoogleAnalytics pod to the app
C. Configure the Crashlytics pod in the app
D. Import the Firebase module to UIApplicationDelegate
Show Answer
Correct Answer:
D. Import the Firebase module to UIApplicationDelegate
Question 20
You have an Azure pipeline that is used to build and deploy an app named App1. The build job uses a Microsoft-hosted Windows agent. The build job for App1 intermittently returns a timeout error. You need to ensure that the build job completes successfully. The solution must minimize administrative effort. What should you do?
A. Change the configuration of the build agent
B. Deploy a self-hosted agent
C. Change to a Microsoft-hosted Linux agent
D. Purchase more parallel jobs
Show Answer
Correct Answer:
D. Purchase more parallel jobs
Aced these? Get the Full Exam
Download the complete AZ-400 study bundle with 308+ questions in a single printable PDF.