Azure DevOps Flashcards

1
Q

What is variable group in Azure DevOps?

A

It is variable group which you define in Azure DevOps and choose as per the environment

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What the different between stages and jobs in the Azure Pipeline

A

A stage is one or more jobs, which are units of work assignable to the same machine. You can arrange both stages and jobs into dependency graphs. Examples include “Run this stage before that one” and “This job depends on the output of that job.”

```yaml
Pipeline
Stage A
Job 1
Step 1.1
Step 1.2

Job 2
Step 2.1
Step 2.2

Stage B

~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is branch policies and approvals?

A

Similar to branch protections and CODEOWNER file. Number of approvals on PR

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

If Azure pipeline is running, you need to cancel it. Azure doesn’t allow you to cancel. How to you troubleshoot it

A

IAM for Azure DevOps, cancel right

Allow stop build, check notion

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

YAML Pipeline, what is trigger. How to configure to run on certain branch

A

Trigger pipeline on Azure DevOps, it will ask you on UI which branch you need to run the pipeline

Another way is code, in the trigger, specify the branch which you want this pipeline to run

Branch name as parameter

https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema/trigger?view=azure-pipelines

```yaml
trigger:
batch: true
branches:
include:
- features/*
exclude:
- features/experimental/*
paths:
exclude:
- README.md

pool:
vmImage: ‘ubuntu-latest’

 steps:
 - task: Maven@3
   inputs:
     mavenPomFile: 'pom.xml'
     mavenOptions: '-Xmx3072m'
     javaHomeOption: 'JDKVersion'
     jdkVersionOption: '1.11'
     jdkArchitectureOption: 'x64'
     publishJUnitResults: false
     testResultsFiles: '**/surefire-reports/TEST-*.xml'
     goals: 'package'

~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

YAML Pipeline, deploy to dev on feature branch, deploy to prod on Main branch

A

Azure Pipeline YAML have expressions

variables:
- group: PROD
- name: env
  ${{ if eq(variables['Build.SourceBranchName'], 'master') }}:
    value: a
  ${{ else }}:
    value: b

steps:
- script: |
echo ‘$(name)’
echo ‘$(env)’
~~~
~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Strategy use of pipeline? Strategy keyword use in the pipeline YAML.

A

Strategy in the pipeline are two type

  • Matrix
  • Parallel

Matrix: It will run number of parallel jobs base on number of rows in the matrix and each job will do what configure in the matrix row block

Parallel: Simply run same job in parallel, e.g. load generator in performance testing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly