Azure DevOps for a Programmer (Part 1): Project, Boards, Repos, and Your First CI Pipeline
Set up a real Azure DevOps project: Boards to organize work, Repos with branch policies, and a YAML CI pipeline for Go.
Table of Contents
It is 9 a.m. and your team’s backlog lives in three places: a spreadsheet nobody updates, a Slack channel, and the head of whoever was on call Friday. The last release broke because a pull request merged without tests and nobody noticed until production. You do not need to hire a DevOps engineer: you need to set up Azure DevOps once, properly, and use the 20% that solves 80% of the problems.
This post is part 1 of two. Here you build the whole project:
- What Azure DevOps is and is not.
- Creating the organization and the project.
- Azure Boards: epics, features, stories, tasks, and bugs.
- Repos with branch policies.
- Your first YAML CI pipeline.
Part 2 covers CD with environments and approvals, variable groups with Key Vault, Artifacts, and Terraform to manage Azure DevOps as code.
Everything uses real commands, explained clicks, and a Go 1.27 example. If you do not use Go, the YAML adapts easily: the concepts matter, not the language.
Important clarification: Azure DevOps does not require an Azure subscription. It is an independent service: you can deploy anywhere (your VPS, Kubernetes, AWS, Cloudflare). Only the brand and the Microsoft ecosystem are shared.
What Azure DevOps is and is not
Azure DevOps is a suite of services that takes software from idea to production. It has three levels:
flowchart TB
ORG["Organization<br/>https://dev.azure.com/my-org"] --> PROJ["Project<br/>MyProduct"]
PROJ --> BOARDS["Boards<br/>backlog, sprints, bugs"]
PROJ --> REPOS["Repos<br/>git, pull requests"]
PROJ --> PIPE["Pipelines<br/>YAML CI/CD"]
PROJ --> ART["Artifacts<br/>packages and feeds"]
PROJ --> TEST["Test Plans<br/>test cases and runs"]
- Organization: your account. It groups projects, users, and permissions. Its URL is
https://dev.azure.com/<org>. - Project: the container for one product. Repos, boards, pipelines, and teams live here.
- Services: Boards (work management), Repos (code), Pipelines (CI/CD), Artifacts (packages), and Test Plans (manual testing).
There is also Azure DevOps Server for on-premises installs, but this post uses the cloud service.
Azure DevOps vs GitHub vs GitLab
| Concept | Azure DevOps | GitHub | GitLab |
|---|---|---|---|
| Code and PRs | Repos | Repositories | Repositories / Merge requests |
| Backlog | Boards | Issues + Projects | Issues + Boards |
| CI/CD | Pipelines | Actions | CI/CD |
| Packages | Artifacts | Packages | Package Registry |
| Manual testing | Test Plans | (external or issues) | Test cases |
If you come from GitHub, the mental map is: Boards ≈ Issues + Projects, Repos ≈ Repositories, Pipelines ≈ Actions, and “service connections” ≈ Actions secrets with permissions to a resource.
What it costs (at the time of writing)
| Plan | What it includes |
|---|---|
| Basic (free) | 5 users, 1,800 minutes/month of Microsoft-hosted agents, unlimited repos |
| Paid Basic | Around $6 per user/month |
| Basic + Test Plans | Around $52 per user/month |
| Self-hosted agent | Free; you pay for the machine and maintenance |
| Extra Microsoft-hosted job | Around $40/month |
Prices change; check the official page before buying. For a solo developer or a team of three, the free plan lasts a long time.
Creating the organization and the project
Step 1: the organization
- Go to https://dev.azure.com with a Microsoft account (the same one can serve Azure, Outlook, or Xbox; you do not need a new one).
- Accept the terms and create an organization with a unique name, for example
my-org. The URL becomeshttps://dev.azure.com/my-org. - If it offers a region, choose carefully: it determines where your data is hosted and usually cannot be changed later.
Step 2: the project
On the organization page: New project.
| Field | What to enter |
|---|---|
| Name | MyProduct (no odd characters; it appears in URLs) |
| Description | One sentence about what it is |
| Visibility | Private unless you want a public portfolio |
| Version control | Git |
| Work item process | Agile (see the table below) |
Choose the process well. It defines which work item types exist, and changing it later is painful (possible, but painful):
| Process | Main types | When to use it |
|---|---|---|
| Basic | Epic, Issue, Task | Small team, zero ceremony |
| Agile | Epic, Feature, User Story, Task, Bug | Classic product backlog |
| Scrum | Epic, Feature, Product Backlog Item, Task, Bug, Impediment | Strict sprints |
| CMMI | Requirement, Change Request, Risk, Review… | Regulated or formal |
This post uses Agile: the middle ground and the one you will see in most companies.
Step 3: the same project from the CLI
The az CLI with the azure-devops extension lets you automate everything. Installation:
# Azure CLI already installed; add the extension
az extension add --name azure-devops
# Authenticate with a PAT (created in the Repos section)
az devops login --organization https://dev.azure.com/my-org
# Store organization and project defaults so you do not repeat them
az devops configure --defaults organization=https://dev.azure.com/my-org project=MyProduct
# Verify
az devops configure --list
Creating the equivalent project:
az devops project create \
--name "MyProduct" \
--description "Team notes API" \
--process Agile \
--source-control git \
--visibility private
No magic: each flag maps to a form field. If you forget one, az devops project create --help explains it.
Step 4: teams and area paths
A project can have several teams. Each team’s board is filtered by Area Path.
- Area Path = “which part of the product is this?” (
MyProduct\Backend,MyProduct\Frontend). - Iteration Path = “when do we do it?” (
MyProduct\Sprint 1). - Team = “who does it?” and which areas/iterations they see on their board.
Configuration: Project settings → Boards → Project configuration to create areas and iterations; Project settings → Teams to create teams and assign areas.
Practical rule: one project per product, not per team. Teams are separated with Area Paths inside the same project, so you share repos and permissions without duplicating infrastructure.
Azure Boards for real
Boards is the backlog. It has hierarchy, states, sprints, and links to commits. As a programmer, the right question is not “how do I use Boards?” but: what information do I need to make decisions about the work?
The hierarchy
flowchart TB
E["Epic<br/>large goal"] --> F["Feature<br/>deliverable capability"]
F --> S["User Story<br/>user value"]
S --> T["Task<br/>technical work"]
S --> B["Bug<br/>something broken"]
T --> B
| Type | What it represents | Example |
|---|---|---|
| Epic | Business goal, months | “Billing module” |
| Feature | Deliverable capability | “PDF invoices” |
| User Story | Small value, days | “As a customer I want to download my invoice” |
| Task | Concrete technical work | “GET /invoices/:id/pdf endpoint” |
| Bug | Defect | “The PDF is missing VAT” |
The rule: if it does not fit in a sprint, it is not a story, it is a feature. If you do not need to track it, do not create it.
Creating an Epic and breaking it down
- Boards → Backlogs → New Work Item → Epic. Title, description, Area Path, and Iteration Path.
- Open the Epic and use Add link → Child (or drag from the backlog) to create Features.
- From the backlog, change the level selector at the top (Epics / Features / Stories) to see each level.
- Assign a Story to a sprint with Iteration Path (for example
MyProduct\Sprint 1).
From the CLI:
az boards work-item create \
--type "User Story" \
--title "Download invoice as PDF" \
--area "MyProduct\\Backend" \
--iteration "MyProduct\\Sprint 1" \
--assigned-to "you@example.com" \
--description "As a customer I want to download my invoice as a PDF."
Note the double backslash: in bash \ is an escape character; in PowerShell use a single \.
The board and WIP limits
Boards → Boards shows stories as cards in columns: New → Active → Resolved → Closed.
- Drag cards as you change state.
- WIP limit: in a column’s settings you can cap how many cards fit. If the limit is 3 and there are 4, the board flags it in red.
- Why? Because work in progress, not work started, is what delays you. The limit is a visual reminder, not a punishment.
Sprints, capacity, and burndown
- Boards → Sprints: pick the sprint, see the backlog and the task board.
- Capacity: declare hours or points per person and per day. It keeps you from promising the impossible.
- Burndown: remaining work during the sprint. If the line does not drop, the problem is not the chart, it is blocked work.
Linking commits and PRs with AB#
This is the bridge between Boards and Repos. In a commit message or PR description, write AB#<id>:
git commit -m "feat(invoices): generate PDF with VAT AB#42"
git commit -m "fix(invoices): fix VAT rounding
Fixes AB#42"
AB#42links the commit to work item 42.Fixes AB#42also closes it on merge (if the state allows it).- The work item must be in the same Azure DevOps organization.
- In PRs it works in the title and the description.
You will see the link on the work item under Links, and on the PR under “Linked work items”. That answers “why does this change exist?” six months later.
Queries: questions you ask every week
Boards → Queries → New query. Examples worth saving:
| Query | Filters |
|---|---|
| Open bugs in my area | Work Item Type = Bug; State <> Closed; Area Path Under MyProduct\Backend |
| Sprint tech debt | Work Item Type = Task; Tags Contains tech-debt; Iteration Path = @CurrentIteration |
| Unestimated | Story Points = (empty); State = New |
| Blocked | Tags Contains blocked; State <> Closed |
Save them as shared queries and put them on the team dashboard. A query nobody reads is useless.
Mini real case: production bug
- The report arrives: “the invoice PDF is missing VAT”.
- You create a Bug with reproduction steps, logs, and environment.
- You attach a technical Task: “review calculation in InvoiceService”.
- The branch is
bugfix/invoice-vat, the commit saysfix: ... AB#57, the PR closes withFixes AB#57. - On merge, the Bug moves to Resolved; QA verifies and closes it.
The whole thread stays visible: report → code → PR → release.
Repos and branch policies
Creating the repository and cloning it
In Repos → Files → Repository selector → New repository, or via CLI:
az repos create --name "my-api" --project "MyProduct"
Clone over HTTPS:
git clone https://dev.azure.com/my-org/MyProduct/_git/my-api
cd my-api
Authentication: PAT, SSH, or credential manager
Azure Repos does not accept your normal password over HTTPS. Options:
PAT (Personal Access Token), the simplest:
- User settings (top right) → Personal access tokens → New token.
- Name, organization, short expiration (30–90 days), and minimal scopes:
Code (read & write)for repos.Build (read & execute)if the CLI will create pipelines.Work items (read & write)for Boards.
- Copy it once and store it in your password manager.
- Use it as the “password” when Git asks over HTTPS.
For the CLI, export it:
export AZURE_DEVOPS_EXT_PAT="your_pat_here"
SSH, more comfortable long term:
ssh-keygen -t ed25519 -C "you@example.com"
cat ~/.ssh/id_ed25519.pub
# Azure DevOps → User settings → SSH public keys → New key → paste the public key
git clone git@ssh.dev.azure.com:v3/my-org/MyProduct/my-api
Never commit the PAT or the private key. If you suspect a leak, revoke it immediately.
Branch strategy
You do not need full Gitflow for a team of three. A healthy baseline:
mainprotected and always green (deployable).- Short branches
feature/<something>,bugfix/<something>,chore/<something>. - Small PRs: if the diff does not fit in one review screen, it is two PRs.
- Delete the branch after merging.
If your team needs Gitflow (environments, releases, hotfixes), there is a way to do it in Azure Repos; I cover it in Gitflow and GitOps best practices. If you prefer frequent merges to main, search my Spanish trunk-based guide in the blog.
Branch policies: the part that prevents pain
Repos → Branches → main → … → Branch policies (or Project settings → Repos → Repositories).
| Policy | What it does | Recommendation |
|---|---|---|
| Require a minimum number of reviewers | No PR merges without review | 1 if solo, 2 on a team |
| Check for linked work items | Every change answers a work item | Enable it |
| Check for comment resolution | No unresolved comments | Enable it |
| Limit merge types | Avoids history-cluttering merges | Squash merge |
| Build validation | The PR does not merge if CI fails | Enable it (needs the pipeline) |
| Automatically included reviewers | Required reviewers by path | For example, infra/ |
| Status policy | Integrates an external check (Sonar, scanner) | Only if you have the tool |
Note: Build validation requires the pipeline to exist first. That is why this post creates the pipeline before enabling that policy.
Also, in Repositories → Settings you can enable:
Enable squash merge(and disable the other merge types if you want a single merge style).- A required commit message format if your team needs it.
Full flow for a change
git checkout main
git pull
git checkout -b feature/section-validation
# ... edit code ...
git add .
git commit -m "feat(api): validate overlapping sections AB#42"
git push -u origin feature/section-validation
Then in the browser: Create pull request, title, description with Fixes AB#42, reviewers, and Set auto-complete if you want it to merge itself once all policies pass.
After merging: squash, delete the branch, git checkout main && git pull.
Your first YAML CI pipeline
What a pipeline is and what pieces it has
flowchart LR
PUSH["Push / PR to main"] --> TRIG["Trigger"]
TRIG --> STAGE["Stage: CI"]
STAGE --> JOB["Job: build_test"]
JOB --> AGENT["Agent<br/>ubuntu-latest"]
AGENT --> STEPS["Steps<br/>GoTool, Cache, go test, build"]
STEPS --> ART["Artifact<br/>api binary"]
- Trigger: which event starts it (push to
main, PR, schedule). - Stage: a logical phase (
CI,DeployProd). - Job: a set of steps that run on an agent. Two jobs can run in parallel.
- Step: a concrete task: a
scriptor atask(GoTool@0,Cache@2). - Agent: the machine that runs it.
vmImage: ubuntu-latestis an ephemeral Microsoft-hosted agent. - Artifact: the result you keep for another stage (binary, coverage, container).
Creating the pipeline
- Pipelines → New pipeline.
Azure Repos Git→ selectmy-api.Starter pipeline, orExisting Azure Pipelines YAML fileif the file already exists.- Replace the content with the YAML below.
- Save and run. The first run usually fails: that is part of the process.
The full YAML, commented
# Triggers on push to main, only if code or the YAML itself changes.
trigger:
branches:
include:
- main
paths:
exclude:
- docs/**
- README.md
# And also on pull requests into main.
pr:
branches:
include:
- main
# Ephemeral Microsoft-hosted Ubuntu agent.
pool:
vmImage: ubuntu-latest
# Variables available as environment variables inside scripts.
variables:
GO_VERSION: "1.27"
CGO_ENABLED: "0" # static binary, easier to deploy
GOMODCACHE: $(Pipeline.Workspace)/go-mod-cache
stages:
- stage: CI
displayName: Continuous integration
jobs:
- job: build_test
displayName: Build and tests
steps:
# 1. Install the exact Go version (do not trust the agent's).
- task: GoTool@0
displayName: Install Go $(GO_VERSION)
inputs:
version: $(GO_VERSION)
# 2. Cache modules between runs. The key depends on go.sum:
# if dependencies change, the cache invalidates itself.
- task: Cache@2
displayName: Go module cache
inputs:
key: 'gomod | "$(Agent.OS)" | go.sum'
restoreKeys: |
gomod | "$(Agent.OS)"
path: $(GOMODCACHE)
# 3. Download dependencies (uses the cache on a hit).
- script: go mod download
displayName: Download dependencies
# 4. Basic static analysis.
- script: go vet ./...
displayName: go vet
# 5. Tests with the race detector and coverage.
- script: go test -race -coverprofile=coverage.out ./...
displayName: Tests with -race
# 6. Print the coverage summary to the log.
- script: go tool cover -func=coverage.out
displayName: Coverage summary
# 7. Build the binary into the artifacts folder.
- script: |
mkdir -p $(Build.ArtifactStagingDirectory)
go build -trimpath -o $(Build.ArtifactStagingDirectory)/api ./cmd/api
displayName: Build api
# 8. Publish the artifact so another stage (deploy) consumes it.
- publish: $(Build.ArtifactStagingDirectory)
artifact: api
Line by line: why each piece exists
trigger and paths. If only the README changed, do not burn agent minutes. If the YAML changed, you do want it to run.
pr. With Azure Repos, a PR triggers the pipeline anyway. This is what Build validation later uses to block the merge when it fails.
pool.vmImage. ubuntu-latest ships Git, Docker, and many tools. It does not ship the Go version you want: hence GoTool@0.
variables. They are not magic constants: they become environment variables for scripts. CGO_ENABLED=0 produces a static binary.
GoTool@0. Installs Go and sets GOROOT/PATH for the following steps. Without it, you depend on the agent’s preinstalled version, which changes without warning.
Cache@2. Stores $(GOMODCACHE) between runs. The key includes the go.sum hash; restoreKeys lets it recover an older cache even when go.sum changed (whatever matches is reused).
go vet. Finds code that compiles but is wrong (bad Printf formatting, suspicious lock copies). It is fast and cheap.
go test -race. Compiles with the race detector. Slower; worth it in CI. If you have integration tests that need Postgres, use services: in the job or testcontainers.
go tool cover. Prints per-function coverage in the log. If you want a threshold that breaks the build:
total=$(go tool cover -func=coverage.out | tail -1 | awk '{print $3}' | tr -d '%')
awk -v t="$total" 'BEGIN { exit (t < 70) }' || { echo "Coverage $total% < 70%"; exit 1; }
publish. It is the shortcut for PublishPipelineArtifact@1. The deploy stage in part 2 will download that artifact instead of rebuilding.
Running it and reading the log
After saving, Run. The log shows each step with its duration and output. What usually happens:
- Green on the first try: congratulations, but check that the tests actually ran (a
./...with no packages does not fail). - Red on
go vet: fix the finding, do not silence it. - Red on tests with
-race: you have a real race condition. That is the best time to find it.
Push the YAML in a PR, not directly to main:
git checkout -b ci/first-pipeline
git add azure-pipelines.yml
git commit -m "ci: first build and test pipeline AB#43"
git push -u origin ci/first-pipeline
Once the pipeline is green, enable Build validation on the main policy pointing at it.
Common errors (and their real cause)
| Symptom | Cause | Fix |
|---|---|---|
go: command not found |
No GoTool or it failed | Make sure GoTool@0 runs before the script |
unexpected EOF while reading a secret |
Secret variable not mapped | Pass it with env: in the step |
TF401019: The Git repository ... does not exist |
PAT missing the Code scope |
New PAT with the right scope |
Could not resolve host |
Agent without network or a wrong URL | Check the URL and whether the self-hosted agent has egress |
| Tests pass locally, fail in CI | Depends on paths, timezone, or a local database | Pin versions and use services:/testcontainers |
| Pipeline runs but the PR does not block | Build validation not enabled | Enable it in Branch policies |
| Cache never hits | key includes something that always changes (date, run id) |
Use the go.sum hash |
About secrets: when you need one (API key, deploy token), do not write it in the YAML. Part 2 covers variable groups and Key Vault; for now, if it is urgent, define it as a secret variable in the pipeline UI and map it like this:
- script: ./deploy.sh
displayName: Deploy
env:
DEPLOY_TOKEN: $(DEPLOY_TOKEN) # this is how it reaches the script
Checklist of what you now have
- Organization and project with the Agile process.
- Team with Area Path and Iteration Path.
- Boards with Epic → Feature → Story → Task/Bug and
AB#linking commits. - Repo with
mainprotected: reviewers, linked work item, squash. - YAML CI pipeline: Go 1.27, cache,
vet,-race, coverage, and artifact. - Build validation blocking red PRs.
That is already a serious foundation: every change goes through a work item, a review, and a reproducible build.
What comes in part 2
- CD with environments: manual approvals, checks, and allowed branches.
- Service connections and a real deployment.
- Variable groups + Key Vault: secrets that do not live in the YAML.
- Artifacts: package and container feeds.
- Terraform for Azure DevOps: recreate organization, project, teams, repos, and pipelines as code.
If you are interested in the infrastructure side, meanwhile read The complete Terraform guide for agile teams and Go networking and Azure cloud architecture. If you want to improve the quality of the Go packages this pipeline will compile, see the Go packages guide.
Summary in one sentence: Azure DevOps is not a Microsoft tool designed to make you suffer; it is an operating system for your team’s work. Boards decide what, Repos decide how, Pipelines verify that it works. When those three pieces talk to each other, you stop asking “whatever happened with that?” and start asking “what do we build next?”.
Related articles
By relevance
Terraform: The Complete Guide from First Resource to Team IaC
Master Terraform from zero to team-scale: providers, state, modules, workspaces, remote backends, CI/CD pipelines, and how IaC fits into an agile sprint workflow.
K3s for Agile Teams: Feature Branches, QA, Staging, and Production on One Cluster
How to run a full agile environment lifecycle on K3s: dynamic feature branch previews, QA gates, staging mirrors, production RBAC, GitOps promotion pipelines, and safe database migrations.
Go BDD Testing with Gherkin and Kubernetes: End-to-End Testing at Scale
Master behavioral-driven development in Go with Gherkin syntax. Learn how to write readable tests, integrate with Kubernetes, mock services, manage state, and validate production deployments with confidence.
BDD, TDD & Agile Tools in Go: From Zero to Professional — The Complete Guide
Master Behavior Driven Development with Gherkin, Godog, TDD, Docker, and CI/CD from a developer's perspective. A complete guide from absolute beginner to deep professional using Go.