0
0
Azurecloud~10 mins

Build pipeline basics in Azure - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the trigger branch for the build pipeline.

Azure
trigger:
  branches:
    include:
      - [1]
Drag options to blanks, or click blank then click option'
Amain
Bbuild
Crelease
Ddev
Attempts:
3 left
💡 Hint
Common Mistakes
Using a branch name that does not exist in the repository.
Leaving the trigger section empty.
2fill in blank
medium

Complete the code to specify the agent pool for the build job.

Azure
pool:
  vmImage: '[1]'
Drag options to blanks, or click blank then click option'
Adebian-9
Bwindows-2016
Cmacos-10.15
Dubuntu-latest
Attempts:
3 left
💡 Hint
Common Mistakes
Using an unsupported or misspelled VM image name.
Omitting quotes around the VM image name.
3fill in blank
hard

Fix the error in the script step to run a shell command.

Azure
- script: echo Hello, world!
  displayName: 'Run a one-line script'
  shell: [1]
Drag options to blanks, or click blank then click option'
Abash
Bpowershell
Ccmd
Dsh
Attempts:
3 left
💡 Hint
Common Mistakes
Using powershell on a Linux agent.
Using cmd which is Windows-only.
4fill in blank
hard

Fill both blanks to define a job with a step that installs Node.js version 16.

Azure
jobs:
- job: Build
  pool:
    vmImage: '[1]'
  steps:
  - task: NodeTool@0
    inputs:
      versionSpec: '[2]'
    displayName: 'Install Node.js'
Drag options to blanks, or click blank then click option'
Aubuntu-latest
Bwindows-latest
C16.x
D14.x
Attempts:
3 left
💡 Hint
Common Mistakes
Using a Windows VM image but expecting Linux commands.
Specifying an unsupported Node.js version.
5fill in blank
hard

Fill all three blanks to create a build pipeline that triggers on the main branch, uses Ubuntu, and runs a script step.

Azure
trigger:
  branches:
    include:
      - [1]
pool:
  vmImage: '[2]'
steps:
- script: |
    echo Building project
    echo Done
  displayName: '[3]'
Drag options to blanks, or click blank then click option'
Amain
Bubuntu-latest
CRun build script
Drelease
Attempts:
3 left
💡 Hint
Common Mistakes
Using a branch name that does not exist.
Forgetting to quote the VM image name.
Leaving the display name blank or unclear.