ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 464 - AZ-400 discussion

Report
Export

SIMULATION

Task 8

Initialize the default main branch, if it does not exist already.

In Project 1, you need to create a new Azure Pipelines YAML pipeline by using the ASP.NET template.

The pipeline must use Azure Repos as the hosting platform and must be created in a new branch named azure-pipelines.

A.
See the solution below in explanation
Answers
A.
See the solution below in explanation
Suggested answer: A

Explanation:

Step 1: Initialize the Default Main Branch

Navigate to Azure DevOps:

Go to Azure DevOps and sign in with your credentials.

Select Your Project:

ChooseProject1from your list of projects.

Initialize the Main Branch:

Go toRepos>Files.

If the main branch does not exist, you will see an option to initialize it.Click onInitializeand follow the prompts to create the main branch1.

Step 2: Create a New Branch for the Pipeline

Navigate to Branches:

Go toRepos>Branches.

Click onNew branch.

Create the Branch:

Enterazure-pipelinesas the branch name.

Selectmainas the base branch.

ClickCreate2.

Step 3: Create a New Azure Pipelines YAML Pipeline

Navigate to Pipelines:

Go toPipelines>New pipeline.

Select the Repository:

ChooseAzure Repos Gitand select the relevant repository.

Configure the Pipeline:

SelectStarter pipeline.

Replace the default YAML with the ASP.NET template. You can find the ASP.NET template in the Azure Pipelines documentation or use the following example:

trigger:

- main

pool:

vmImage: 'windows-latest'

variables:

buildConfiguration: 'Release'

steps:

- task: UseDotNet@2

inputs:

packageType: 'sdk'

installationPath: $(Agent.ToolsDirectory)/dotnet

- script: |

dotnet build --configuration $(buildConfiguration)

displayName: 'Build project'

- script: |

dotnet test --no-build --configuration $(buildConfiguration)

displayName: 'Run tests'

Save the Pipeline:

Click onSaveand enterazure-pipelinesas the branch name.

Click onSave and runto save the pipeline to the new branch namedazure-pipelines3.

By following these steps, you will have successfully initialized the main branch, created a new branch namedazure-pipelines, and set up a new Azure Pipelines YAML pipeline using the ASP.NET template

asked 02/10/2024
ONWUDIWE NYENKE
36 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first