Azure-Devops
Azure-Devops
Answer:
Azure DevOps is a cloud service provided by Microsoft that supports end-to-end
software development and delivery. It offers the following services:
● Azure Repos: Version control using Git or Team Foundation Version Control
(TFVC).
● Azure Pipelines: Build and release management through CI/CD.
● Azure Boards: Agile project management with Kanban boards, Scrum, and
tracking tools.
● Azure Test Plans: Manual and automated testing services.
● Azure Artifacts: Package management for NuGet, npm, Maven, etc.
Answer:
To create a YAML-based pipeline:
steps:
- task: UseNode@2
inputs:
version: '14.x'
- script: |
npm install npm
test
displayName: 'Install dependencies and run tests'
Answer:
Azure Repos supports the following branching strategies:
● Feature Branching: Create a branch for each feature; merge into main or
develop after completion.
● GitFlow: Uses main, develop, and supporting branches (feature, release,
hotfix).
● Release Flow: Create branches for releases, keep main stable. Use policies like
branch policies, pull requests, and required reviewers to enforce best practices.
4. How do you configure a Multi-Stage Pipeline in Azure Pipelines?
Answer:
A Multi-Stage Pipeline allows you to define multiple stages (e.g., Build, Test, Deploy) in a
YAML file:
stages:
- stage: Build
jobs:
- job: BuildJob
steps:
- script: echo "Building project"
- stage: Deploy
dependsOn: Build
jobs:
- job: DeployJob
steps:
- script: echo "Deploying application"
Answer:
Use Azure Key Vault or Pipeline Variables:
6. What are pull requests, and how are they managed in Azure Repos?
Answer:
A pull request is a mechanism to merge code changes from one branch into another.
Answer:
Branch policies enforce standards to protect branches:
Answer:
Self-hosted agents run on your infrastructure rather than Azure-hosted pools:
Answer:
Artifacts are the output of a build pipeline that can be used in release pipelines:
● Examples: Compiled binaries, Docker images, or configuration files.
Answer:
11. What are swimlanes in Azure Boards, and how are they used?
Answer:
Swimlanes organize work items on Kanban boards:
Answer:
● Go to the Project Settings → Process.
● Select a process (e.g., Scrum or Agile) and customize fields, layouts, and rules for
work items.
Answer:
Universal Packages are a mechanism to store and share large files:
Answer:
Answer:
16. How can you link test cases to requirements in Azure Boards?
Answer:
17. What are Service Principals, and how do you use them in Azure DevOps?
Answer:
Service Principals are Azure AD applications used for authentication:
Answer:
Answer:
Blue-Green Deployment minimizes downtime by having two environments:
Answer:
Gates are pre-deployment or post-deployment checks in release pipelines:
● Examples: Invoke REST APIs, check monitoring metrics.
● Configure Gates under pipeline settings.
Answer:
Answer:
Answer:
Pipeline triggers automate pipeline execution. Types include:
trigger:
branches:
include:
- main
24. What is deployment strategy in Azure Pipelines?
Answer:
Deployment strategies control how changes are rolled out:
Answer:
Pipeline variables store values used in pipelines:
variables:
environment: 'QA'
steps:
Answer:
Use the condition property:
steps:
condition: eq(variables['Build.SourceBranchName'],
'main')
27. What is the difference between an Epic and a Feature in Azure Boards?
Answer:
Answer:
29. What are Work Item Queries, and how are they used?
Answer:
Queries filter and group work items:
30. What is the difference between feeds and packages in Azure Artifacts?
Answer:
31. How do you set up retention policies for packages in Azure Artifacts?
Answer:
Answer:
● Add a service hook for Slack or Teams in Project Settings → Service Hooks.
● Configure notifications for work item updates, pull requests, or pipeline statuses.
Answer:
34. What are test plans, and how do you create them in Azure Test Plans?
Answer:
Test plans define the scope of manual and automated tests:
Answer:
Answer:
Answer:
Answer:
steps:
# Main pipeline
stages:
- stage: Build
jobs:
- template: build-template.yml
39. How do you monitor pipeline performance in Azure DevOps?
Answer:
Answer:
41. How do you handle multiple environments (Dev, QA, Prod) in pipelines?
Answer:
- stage: Dev
variables:
environment: 'Dev'
- stage: QA
dependsOn: Dev
variables:
environment: 'QA'
42. What is the best way to manage secrets in Azure Pipelines?
Answer:
43. What are agent pools, and how are they managed?
Answer:
Answer:
45. What is a Multi-Stage YAML Pipeline, and how does it differ from a classic release
pipeline?
Answer:
A Multi-Stage YAML Pipeline defines the build and release process in a single YAML file,
offering version control and infrastructure-as-code benefits:
Answer:
Use the parallel property:
jobs:
- job: Build1
steps:
- job: Build2
steps:
47. What are deployment slots, and how are they used with Azure Web Apps?
Answer:
Deployment slots allow multiple live environments for Azure Web Apps:
Answer:
Answer:
● A cumulative flow diagram shows the status of work items over time.
● Useful for identifying bottlenecks and tracking progress.
Answer:
Answer:
52. What is the difference between a hosted feed and an external feed?
Answer:
Answer:
Answer:
Service connections provide secure access to external services like Azure, AWS, or
Kubernetes clusters:
● Create under Project Settings → Service Connections.
● Use in pipelines for deployments or integrations.
Answer:
Use tasks specific to testing frameworks:
inputs:
command: 'test'
projects: '**/*.Tests.csproj'
Answer:
Test configurations define environment parameters (e.g., OS, browser) to validate across
multiple scenarios.
Answer:
paths:
include:
- src/project1/*
Answer:
Pipeline decorators inject steps into existing pipelines:
Answer:
inputs:
app'
tags: '$(Build.BuildId)'
Answer:
Answer:
Answer:
inputs:
'node_modules'
Answer:
Answer:
Answer:
67. What are gated check-ins in Azure Pipelines, and how do you configure them?
Answer:
Gated check-ins ensure that code changes build successfully before being committed:
Answer:
Use variables to generate unique artifact versions:
variables:
buildVersion: '1.0.$(Build.BuildId)'
steps:
- script: echo
"##vso[build.updatebuildnumber]$(buildVersion)"
69. What is a deployment queue, and why is it useful?
Answer:
Deployment queues manage parallel deployments to avoid resource contention:
Answer:
Answer:
72. How do you manage dependencies between work items in Azure Boards?
Answer:
● Use Link Work Items to establish relationships like "Blocks" or "Depends On."
● Visualize dependencies using queries or boards.
73. What is the difference between a Kanban board and a Scrum board?
Answer:
Answer:
Answer:
76. What are the differences between OAuth tokens and PATs?
Answer:
Answer:
Answer:
Answer:
- stage: Build
- stage: Test
dependsOn: Build
jobs:
- job: RunTests
steps:
- task: VSTest@2
inputs:
'**/*.dll'
Answer:
Example:
Stages:
- stage: Deploy
condition: eq(variables['Build.SourceBranchName'],
'main')
Answer:
inputs:
azureSubscription: 'AzureServiceConnection'
appType: 'functionApp'
appName: 'MyFunctionApp'
Answer:
Answer:
Answer:
Answer:
Answer:
87. What are agent capabilities, and how do they affect pipelines?
Answer:
● Capabilities define what an agent can execute (e.g., specific tools or software).
● Match job demands with agent capabilities to ensure successful pipeline
execution.
Answer:
Answer:
- name: environment
Answer:
steps:
Answer:
Answer:
Rolling deployments update a subset of instances at a time to ensure availability:
rolling:
maxSurge: 1
maxUnavailable: 0
93. How do you use conditional insertion for tasks in Azure Pipelines?
Answer:
Add the condition property to dynamically include tasks:
steps:
condition: eq(variables['Build.SourceBranchName'],
'main')
94. What are pipeline stages, and how do you organize them?
Answer:
Stages divide the pipeline into logical groups (e.g., Build, Test, Deploy):
Example YAML:
stages:
- stage: Build
jobs:
- job: BuildJob
- stage: Deploy
dependsOn: Build
jobs:
- job: DeployJob
Answer:
Answer:
97. How do you use tags in work items for better organization?
Answer:
Answer:
Use pipeline tasks like NuGetCommand@2 or npm:
- task: NuGetCommand@2
inputs:
command: 'push'
packagesToPush: '**/*.nupkg'
publishFeed: 'MyFeed'
Answer:
Answer:
Environment permissions control who can deploy to specific environments:
Answer:
Answer:
Answer:
Add Selenium test tasks in the pipeline:
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.x'
- script: |
python run_tests.py
104. What is code coverage, and how do you measure it in Azure Pipelines?
Answer:
Code coverage determines the percentage of code tested:
inputs:
codeCoverageTool: 'Cobertura'
summaryFileLocation: 'coverage.xml'
105. How do you implement approval workflows in Azure Pipelines?
Answer:
Use environments with manual or automated approvals:
Example:
environment:
name: 'QA'
resourceName: 'MyEnvironment'
approvals:
- user: '[email protected]'
Answer:
inputs:
path: 'node_modules'
107. What are Azure Resource Manager (ARM) templates, and how are they used in
Azure DevOps?
Answer:
ARM templates define Azure infrastructure as code:
inputs:
csmFile: 'template.json'
Answer:
featureX: true
steps:
109. How do you implement disaster recovery for Azure DevOps pipelines?
Answer:
Answer:
Deploy Azure Functions or AWS Lambda using tasks:
- task: AzureFunctionApp@1
inputs:
azureSubscription: 'MySubscription'
appName: 'MyFunctionApp'
Answer:
112. What are build retention policies, and how are they configured?
Answer:
Retention policies clean up old builds:
Answer:
Use resources in YAML:
resources:
repositories:
- repository: Repo2
type: git
name: OrgName/Repo2
114. How do you configure Azure DevOps for hybrid cloud deployments?
Answer:
Answer:
Answer:
Matrix builds run jobs in parallel with different configurations:
jobs:
- job: MatrixBuild
strategy:
matrix:
Linux:
vmImage: 'ubuntu-latest'
Windows:
vmImage: 'windows-latest'
steps:
Answer:
Use pipeline artifacts or caching:
inputs:
targetPath: 'bin/output'
artifact: 'dependencies'
inputs:
artifactName: 'dependencies'
Answer:
Pass parameters into templates for flexibility:
# Template file: build-template.yml
parameters:
- name: buildConfiguration
default: 'Release'
steps:
# Main pipeline
jobs:
- template: build-template.yml
parameters:
buildConfiguration: 'Debug'
Answer:
Answer:
Answer:
Rules automate updates based on triggers (e.g., status changes).
Answer:
123. What are upstream sources, and why are they useful?
Answer:
Upstream sources allow feeds to consume external or internal packages:
Answer:
Answer:
inputs:
secureFile: 'mycertificate.pfx'
127. What is the difference between functional and non-functional testing in Azure
Pipelines?
Answer:
Answer:
129. What are the best practices for managing infrastructure-as-code in Azure
DevOps?
Answer:
Answer:
inputs:
app'
tags: '$(Build.BuildId)'
inputs:
command: 'apply'
Answer:
Answer:
condition: failed()
steps:
133. How do you integrate monitoring tools like Datadog with Azure DevOps?
Answer:
Answer:
135. What are the differences between self-hosted and Microsoft-hosted agents?
Answer:
● Microsoft-Hosted: Pre-configured and managed, but may have usage limits.
● Self-Hosted: Fully customizable, suitable for private environments.
136. How do you set up billing alerts for Azure DevOps usage?
Answer:
137. How do you implement CI/CD for mobile apps using Azure DevOps?
Answer:
inputs:
appSlug: 'org/app'
Answer:
Answer:
branches:
include:
- features/*
Answer:
Use Azure DevOps environments with automated checks:
environment:
name: 'Production'
approval:
- user: '[email protected]'
Answer:
Deployment conditions control stage execution:
stages:
- stage: Deploy
condition: and(succeeded(),
eq(variables['Build.SourceBranch'], 'refs/heads/main'))
142. What is the difference between inline scripts and script files in Azure
Pipelines?
Answer:
Answer:
Use Azure Key Vault or variable groups scoped to stages:
variables:
- group: 'MySecrets'
Answer:
Answer:
Answer:
Answer:
Use tools like npm or NuGet to download from the external source and upload to
Azure Artifacts:
npm publish --registry
https://pkgs.dev.azure.com/org/_packaging/feed/npm
Answer:
Deduplication reduces storage usage by avoiding duplicate package uploads. It
ensures efficient space utilization in feeds.
Answer:
Answer:
151. What are custom roles in Azure DevOps, and how do you create them?
Answer:
Answer:
Run JMeter scripts in the pipeline using a container:
steps:
- script: |
Answer:
154. What are the benefits of using YAML pipelines over classic pipelines?
Answer:
Answer:
Answer:
● Use variable groups in Library Settings.
● Store and share variables across pipelines.
Answer:
inputs:
Answer:
Answer:
Answer:
● Use Azure Boards for tracking dependencies with linked work items.
● Establish clear SLA agreements for shared services.
161. What is the best way to manage project templates in Azure DevOps?
Answer:
Answer:
Answer:
- checkout: self
submodules: true
Answer:
Branches:
include:
- main
Answer:
Answer:
Deployment gates are checks before or after a deployment in release pipelines.
Example: Validate a REST API response before proceeding.
gates:
preDeployGates:
- task: InvokeRESTAPI@1
inputs:
method: 'GET'
url: 'https://api.example.com/health'
Answer:
Pipeline variables can be dynamically set during runtime:
steps:
- script: echo "##vso[task.setvariable
variable=dynamicVar]dynamicValue"
- script: echo $(dynamicVar)
168. What are run-time parameters, and how do they differ from variables?
Answer:
parameters:
- name: environment
type: string
default: 'QA'
Answer:
Answer:
Swimlanes organize Kanban boards by categories like priority or work types,
helping teams focus on specific objectives.
Answer:
Answer:
Answer:
Answer:
Answer:
Answer:
Answer:
Answer:
Composite actions are reusable YAML templates that can combine multiple steps:
steps:
- template: my-template.yml
Answer:
Answer:
Answer:
Answer:
Answer:
Answer:
Answer:
Answer:
Answer:
Answer:
Answer:
Answer:
Answer:
193. What are the differences between Azure DevOps and GitHub Actions?
Answer:
Answer:
Answer:
Answer:
Answer:
Answer:
Answer:
200. What are best practices for scaling Azure DevOps across multiple
teams?
Answer: