Azure DevOps
Overview
Azure DevOps is Microsoft's comprehensive DevOps platform that provides tools for planning, developing, testing, and deploying software. It offers seamless integration with Azure cloud services and supports both Microsoft and open-source technologies.
Core Services
Azure Boards
Work tracking and project management tool with Agile planning capabilities.
| Feature |
Description |
Use Case |
| Work Items |
Tasks, bugs, features, epics |
Project tracking |
| Backlogs |
Prioritized work lists |
Sprint planning |
| Boards |
Kanban-style visualization |
Workflow management |
| Sprints |
Time-boxed iterations |
Agile development |
| Queries |
Custom work item searches |
Reporting and analytics |
Work Item Types
# Epic
- Large feature or initiative
- Contains multiple features
- High-level business value
# Feature
- Group of related user stories
- Business functionality
- Medium-level planning
# User Story
- End-user functionality
- Acceptance criteria
- Development tasks
# Task
- Development work items
- Time estimates
- Sprint assignments
# Bug
- Code defects
- Severity levels
- Reproduction steps
Azure Repos
Git-based version control with advanced collaboration features.
| Feature |
Description |
Benefits |
| Git Repositories |
Distributed version control |
Branching and merging |
| Pull Requests |
Code review workflow |
Quality assurance |
| Branch Policies |
Code quality gates |
Prevent bad merges |
| Code Search |
Advanced code searching |
Developer productivity |
| Fork Management |
Repository forking |
Open source workflows |
Branch Policies
# Repository Settings > Policies
# Require minimum reviewers: 2
# Check for linked work items: Required
# Check for comment resolution: Required
# Build validation: Required
# Status policy: Required
Azure Pipelines
CI/CD automation platform supporting multiple languages and platforms.
| Component |
Purpose |
Configuration |
| Build Pipelines |
Compile and test code |
YAML or Classic UI |
| Release Pipelines |
Deploy to environments |
Multi-stage deployments |
| Artifacts |
Package management |
NuGet, npm, Maven |
| Test Integration |
Automated testing |
Unit, integration, UI tests |
| Environments |
Deployment targets |
Dev, Staging, Production |
Pipeline Configuration
YAML Pipeline Example
# azure-pipelines.yml
trigger:
branches:
include:
- main
- develop
pool:
vmImage: 'ubuntu-latest'
variables:
buildConfiguration: 'Release'
dotnetSdkVersion: '6.x'
steps:
- task: UseDotNet@2
displayName: 'Install .NET SDK'
inputs:
version: $(dotnetSdkVersion)
- task: DotNetCoreCLI@2
displayName: 'Restore packages'
inputs:
command: 'restore'
projects: '**/*.csproj'
- task: DotNetCoreCLI@2
displayName: 'Build project'
inputs:
command: 'build'
projects: '**/*.csproj'
arguments: '--configuration $(buildConfiguration)'
- task: DotNetCoreCLI@2
displayName: 'Run tests'
inputs:
command: 'test'
projects: '**/*Tests.csproj'
arguments: '--configuration $(buildConfiguration) --collect "Code coverage"'
- task: DotNetCoreCLI@2
displayName: 'Publish'
inputs:
command: 'publish'
publishWebProjects: true
arguments: '--configuration $(buildConfiguration) --output $(Build.ArtifactStagingDirectory)'
- task: PublishBuildArtifacts@1
displayName: 'Publish artifacts'
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: 'drop'
Multi-Stage Pipeline
# Multi-environment deployment
stages:
- stage: Build
jobs:
- job: Build
steps:
- script: echo "Building application"
- stage: Dev
dependsOn: Build
jobs:
- deployment: DeployDev
environment: 'dev'
strategy:
runOnce:
deploy:
steps:
- script: echo "Deploying to dev"
- stage: Staging
dependsOn: Dev
jobs:
- deployment: DeployStaging
environment: 'staging'
strategy:
runOnce:
deploy:
steps:
- script: echo "Deploying to staging"
- stage: Production
dependsOn: Staging
jobs:
- deployment: DeployProd
environment: 'prod'
strategy:
runOnce:
deploy:
steps:
- script: echo "Deploying to production"
Azure Pipelines Tasks
| Task |
Purpose |
Example |
UseDotNet |
Install .NET SDK |
version: '6.x' |
DotNetCoreCLI |
.NET CLI commands |
command: 'build' |
NodeTool |
Install Node.js |
versionSpec: '16.x' |
Npm |
npm commands |
command: 'install' |
Docker |
Docker operations |
command: 'build' |
AzureWebApp |
Azure deployment |
appName: 'myapp' |
KubernetesManifest |
K8s deployment |
action: 'deploy' |
Azure Test Plans
Comprehensive testing solution for manual and automated testing.
Test Planning
# Test Plan Structure
Test Plan
├── Test Suites
│ ├── Requirement-based
│ ├── Query-based
│ └── Static
├── Test Cases
│ ├── Steps
│ ├── Parameters
│ └── Attachments
└── Test Runs
├── Manual execution
├── Automated execution
└── Exploratory testing
Test Case Template
**Test Case ID:** TC_001
**Title:** User Login Functionality
**Description:** Verify user can log in with valid credentials
**Preconditions:**
- User account exists
- Application is accessible
**Test Steps:**
1. Navigate to login page
2. Enter valid username
3. Enter valid password
4. Click login button
**Expected Results:**
- User is redirected to dashboard
- Welcome message displays
- Session is created
**Test Data:**
- Username: testuser@example.com
- Password: TestPass123
**Post-conditions:**
- User is logged in
- Session persists
Automated Testing Integration
# Pipeline with automated tests
- task: VSTest@2
inputs:
testSelector: 'testAssemblies'
testAssemblyVer2: |
**\*test*.dll
!**\obj\**
searchFolder: '$(System.DefaultWorkingDirectory)'
- task: PublishTestResults@2
inputs:
testResultsFiles: '**/*.trx'
testRunTitle: 'Unit Tests'
mergeTestResults: true
Azure Artifacts
Package management and sharing across teams.
Package Types
| Package Type |
Description |
Use Case |
| NuGet |
.NET packages |
C# libraries |
| npm |
JavaScript packages |
Node.js modules |
| Maven |
Java packages |
Java libraries |
| Python |
Python packages |
Python modules |
| Universal |
Any file type |
Custom packages |
Publishing Packages
# azure-pipelines.yml - Publish NuGet
- task: NuGetCommand@2
inputs:
command: 'pack'
packagesToPack: '**/*.nuspec'
versioningScheme: 'byBuildNumber'
- task: NuGetCommand@2
inputs:
command: 'push'
packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg'
nuGetFeedType: 'internal'
publishVstsFeed: 'my-project/my-feed'
Upstream Sources
# Connect to external feeds
# Azure Artifacts > Feed Settings > Upstream sources
# Add npmjs.org, nuget.org, etc.
Integration with Azure Services
Azure Resource Manager Templates
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"webAppName": {
"type": "string",
"metadata": {
"description": "Name of the web app"
}
}
},
"resources": [
{
"type": "Microsoft.Web/sites",
"apiVersion": "2020-06-01",
"name": "[parameters('webAppName')]",
"location": "[resourceGroup().location]",
"properties": {
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('appServicePlanName'))]"
}
}
]
}
Azure CLI Integration
# Pipeline step for Azure CLI
- task: AzureCLI@2
inputs:
azureSubscription: 'my-service-connection'
scriptType: 'bash'
scriptLocation: 'inlineScript'
inlineScript: |
az webapp deployment source config \
--name $(webAppName) \
--resource-group $(resourceGroup) \
--repo-url $(Build.Repository.Uri) \
--branch main \
--manual-integration
Security and Compliance
Role-Based Access Control
| Role |
Permissions |
Scope |
| Reader |
View resources |
Organization/Project |
| Contributor |
Create/modify |
Project |
| Project Administrator |
Full project control |
Project |
| Organization Owner |
Full organization control |
Organization |
Audit and Compliance
# Enable audit streaming
# Organization Settings > Auditing
# Stream audit events to Log Analytics
# Monitor security events and compliance
Security Features
| Feature |
Description |
Benefits |
| Branch Policies |
Code quality gates |
Prevent bad code |
| Credential Scanning |
Detect secrets |
Security compliance |
| IP Restrictions |
Access control |
Network security |
| Multi-Factor Authentication |
Account security |
Identity protection |
| Conditional Access |
Policy enforcement |
Compliance |
Best Practices
| Practice |
Benefit |
Implementation |
| Use YAML pipelines |
Version control |
Store pipeline as code |
| Implement branch policies |
Code quality |
Require reviews and tests |
| Use environments |
Deployment control |
Approval gates |
| Organize work items |
Project clarity |
Epics → Features → Stories |
| Automate testing |
Quality assurance |
CI/CD integration |
| Monitor pipelines |
Performance tracking |
Analytics and reporting |
| Use service connections |
Secure access |
Managed identities |
| Implement security scanning |
Vulnerability detection |
Integrated security tools |
Pricing and Licensing
Azure DevOps Services
| Plan |
Users |
Features |
Cost |
| Basic |
5 free |
Core features |
Free |
| Basic + Test Plans |
Per user |
Manual testing |
$52/user/month |
| Azure DevOps Server |
Unlimited |
On-premises |
Contact sales |
Azure Pipelines
| Plan |
Free Minutes |
Paid Minutes |
Cost |
| Public Projects |
10 free parallel |
Unlimited |
Free |
| Private Projects |
1 free parallel |
Additional |
$40/parallel job/month |
Common Scenarios
.NET Application Deployment
# Complete .NET pipeline
trigger:
branches:
include:
- main
pool:
vmImage: 'windows-latest'
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
steps:
- task: NuGetToolInstaller@1
- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'
- task: VSBuild@1
inputs:
solution: '$(solution)'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: VSTest@2
inputs:
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(build.artifactstagingdirectory)'
artifactName: 'drop'
Containerized Application
# Docker build and deploy
stages:
- stage: Build
jobs:
- job: Build
steps:
- task: Docker@2
inputs:
containerRegistry: 'my-registry'
repository: 'my-app'
command: 'buildAndPush'
Dockerfile: '**/Dockerfile'
- stage: Deploy
jobs:
- job: Deploy
steps:
- task: KubernetesManifest@0
inputs:
action: 'deploy'
kubernetesServiceConnection: 'my-k8s-connection'
manifests: '**/deployment.yml'
Resources