Microsoft AZ-400 Practice Test - Questions Answers
List of questions
Related questions
Question 1
Your company has an on-premises Bitbucket Server that is used for Git-based source control. The server is protected by a firewall that blocks inbound Internet traffic. You plan to use Azure DevOps to manage the build and release processes.
Which two components are required to integrate Azure DevOps and Bitbucket? Each correct answer presents part of the solution. NOTE: Each correct selection is worth one point.
Explanation:
E: GitLab CI/CD can be used with GitHub or any other get server such as BitBucket. Instead of moving your entire project to GitLab, you can connect your external repository to get the benefits of GitLab CI/CD. Note: When a pipeline uses a remote, 3rd-party repository host such as Bitbucket Cloud, the repository is configured with webhooks that notify Azure Pipelines Server or TFS when code has changed and a build should be triggered. Since on-premises installations are normally protected behind a firewall, 3rd-party webhooks are unable to reach the on-premises server. As a workaround, you can use the External get repository type which uses polling instead of webhooks to trigger a build when code has changed.
Reference: https://docs.microsoft.com/en-us/azure/devops/pipelines/repos/pipeline-options-for-git
Question 2
Your company uses Azure Artifacts for package management.
You need to configure an upstream source in Azure Artifacts for Python packages.
Which repository type should you use as an upstream source?
Explanation:
Get started with Python packages in Azure Artifacts
Create a feed
1. Select Artifacts (in the left navigation of your Azure DevOps project).
2. On the Artifacts page, select Create Feed.
3. In the Create new feed dialog box:
4. In the Name field, give the feed a name.
PyPI is the default repository name for twine, which is a tool for publishing Python packages.
Reference:
https://docs.microsoft.com/en-us/azure/devops/artifacts/quickstarts/python-packages
Question 3
SIMULATION
You plan to deploy a template named D:\Deploy.json to a resource group named Deploy-lod9940427.
You need to modify the template to meet the following requirements, and then to deploy the template:
The address space must be reduced to support only 256 total IP addresses.
The subnet address space must be reduced to support only 64 total IP addresses.
To complete this task, sign in to the Microsoft Azure portal.
Explanation:
1. Sign in to the portal.
2. Choose template Deploy-lod9940427
3. Select Edit template, and then paste your JSON template code into the code window.
4. Change the ASddressPrefixes to 10.0.0.0/24 in order to support only 256 total IP addresses.
addressSpace":{"addressPrefixes": ["10.0.0.0/24"]},
5. Change the firstSubnet addressprefix to 10.0.0.0/26 to support only 64 total IP addresses.
"subnets":[
{
"name":"firstSubnet",
"properties":{
"addressPrefix":"10.0.0.0/24"
}
6. Select Save.
7. Select Edit parameters, provide values for the parameters that are shown, and then select OK.
8. Select Subscription. Choose the subscription you want to use, and then select OK.
9. Select Resource group. Choose an existing resource group or create a new one, and then select OK.
10. Select Create. A new tile on the dashboard tracks the progress of your template deployment.
Reference:
https://docs.microsoft.com/en-us/azure-stack/user/azure-stack-deploy-template-portal?view=azs-1908
https://docs.microsoft.com/en-us/azure/architecture/building-blocks/extending-templates/update-resource
Question 4
SIMULATION
You need to configure an Azure web app named az400-9940427-main to contain an environmental variable named "MAX_ITEMS". The environmental variable must have a value of 50. To complete this task, sign in to the Microsoft Azure portal.
Explanation:
1. In the Azure portal, navigate to the az400-9940427-main app's management page. In the app's left menu, click Configuration > Application settings.
2. Click New Application settings
3. Enter the following:
Name: MAX_ITEMS
Value: 50
Reference:
https://docs.microsoft.com/en-us/azure/app-service/configure-common
Question 5
Your company builds a multi-tier web application.
You use Azure DevOps and host the production application on Azure virtual machines.
Your team prepares an Azure Resource Manager template of the virtual machine that you will use to test new features.
You need to create a staging environment in Azure that meets the following requirements:
Minimizes the cost of Azure hosting
Provisions the virtual machines automatically
Uses the custom Azure Resource Manager template to provision the virtual machines
What should you do?
Explanation:
You can use the Azure DevTest Labs Tasks extension that's installed in Azure DevOps to easily integrate your CI/CD build-and-release pipeline with Azure DevTest Labs. The extension installs three tasks:
Create a VM
Create a custom image from a VM
Delete a VM
The process makes it easy to, for example, quickly deploy a "golden image" for a specific test task and then delete it when the test is finished.
Reference:
https://docs.microsoft.com/en-us/azure/lab-services/devtest-lab-integrate-ci-cd-vsts
Question 6
SIMULATION
You need to ensure that the https://contoso.com/statushook webhook is called every time a repository named az40010480345acr1 receives a new version of an image named dotnetapp.
To complete this task, sign in to the Microsoft Azure portal.
Explanation:
1. Sign in to the Azure portal.
2. Navigate to the container registry az40010480345acr1.
3. Under Services, select Webhooks.
4. Select the existing webhook https://contoso.com/statushook, and double-click on it to get its properties. 5. For Trigger actions select image push
Example web hook:
Reference:
https://docs.microsoft.com/en-us/azure/container-registry/container-registry-webhook
Question 7
Your company uses Azure DevOps to manage the build and release processes for applications.
You use a get 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?
Explanation:
Cherry-pick a pull request
To copy changes made in a pull request to another branch in your repo, follow these steps:
1. In a completed pull request, select Cherry-pick, or for an active pull request, select Cherry-pick from the ... menu. Cherry-picking a pull request in this way creates a new branch with the copied changes. Merge into a target branch in a second pull request.
2. In Target branch, enter the branch you want to merge the copied changes.
3. In Topic branch name, enter a new branch to contain the copied changes, then select Cherry-pick. 4. Select Create pull request to merge the topic branch into the target branch to complete the cherry-pick.
Reference:
https://docs.microsoft.com/en-us/azure/devops/repos/git/pull-requests
Question 8
You are designing a build pipeline in Azure Pipelines.
The pipeline requires a self-hosted agent. The build pipeline will run once daily and will take 30 minutes to complete.
You need to recommend a compute type for the agent. The solution must minimize costs.
What should you recommend?
Explanation:
https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/agents?view=azure- devops&tabs=browser#faq
Question 9
You have a project in Azure DevOps. You have an Azure Resource Group deployment project in Microsoft Visual Studio that is checked in to the Azure DevOps project. You need to create a release pipeline that will deploy resources by using Azure Resource Manager templates. The solution must minimize administrative effort. Which task type should you include in the solution?
Explanation:
There are two different ways to deploy templates to Azure DevOps Services. Both methods provide the same results, so choose the one that best fits your workflow. 1. Add a single step to your build pipeline that runs the PowerShell script that’s included in the Azure Resource Group deployment project (Deploy-AzureResourceGroup.ps1). The script copies artifacts and then deploys the template. 2. Add multiple Azure DevOps Services build steps, each one performing a stage task.
The first option has the advantage of using the same script used by developers in Visual Studio and providing consistency throughout the lifecycle.
Reference:
https://docs.microsoft.com/en-us/azure/vs-azure-tools-resource-groups-ci-in-vsts
Question 10
You have an Azure DevOps project that contains a release pipeline and a get repository.
When a new code revision is committed to the repository, a build and release is triggered.
You need to ensure that release information for the pipeline is added automatically to the work items associated to the Get commit. What should you do?
Explanation:
Question