course
Azure DevOps Tutorial: Build, Test, and Deploy Applications
You’ve just finished writing an excellent code or a data transformation script. You’re ready to deploy it, but then comes the chaos—manual testing, deployment errors, and team members working on outdated code versions. Sounds familiar? This is where Azure DevOps comes in.
Everything you need to develop your software product from start to finish is included in Azure DevOps.
This tutorial teaches you how to set up an Azure DevOps environment, use Azure Repos for version control, create and manage CI/CD pipelines, track and manage work items with Azure Boards, integrate Azure DevOps with other tools, monitoring and Reporting in Azure DevOps, and best practices for Azure DevOps.
What is Azure DevOps?
Azure DevOps is a cloud-based suite of development tools offered by Microsoft that streamlines software development, collaboration, and deployment processes. It offers version control, continuous integration/continuous deployment (CI/CD), work tracking, and more.
Azure DevOps is scalable, integrates seamlessly with Azure and other cloud platforms, and fosters team collaboration. Whether you’re working on a small project or an extensive enterprise application, Azure DevOps has you covered.
Azure DevOps interface: A project overview is provided in the console's main interface.
Azure DevOps comprises a suite of services designed to help teams plan, develop, test, and deliver software efficiently. It’s not just for developers—data practitioners can use it to manage code, automate workflows, and collaborate effectively. Azure DevOps lets you connect to and collaborate across its core services.
Core Services of Azure DevOps include:
Service |
Purpose |
Azure Boards |
Azure Boards facilitates agile project management, including sprints and backlog monitoring, and supports agile approaches by offering a configurable platform for managing work items and tracking tasks, problems, and user stories. |
Azure Repos |
Azure Repos offers version control tools (Git/TFVC) to manage code, track changes, and take snapshots for any project size, offering efficient version control. |
Azure Pipelines |
Azure Pipelines automates builds, testing, and deployments with CI/CD, supporting all major languages and project types for continuous integration, testing, and delivery. |
Azure Test Plans |
Azure Test Plans offers powerful tools for planned manual testing, user acceptance testing, exploratory testing, and stakeholder feedback, supporting test case management and execution. |
Azure Artifacts |
Azure Artifacts provides a more straightforward way to manage dependencies from a single feed. They function as repositories for storing, managing, and sharing packages within teams or publicly. |
Check out our Understanding Microsoft Azure interactive course if you’re just starting your Azure journey. You should also check out our Microsoft Azure Fundamentals track, which will help you prepare to become Azure-certified.
Features of Azure DevOps
Now that we’ve learned a little about Azure DevOps let’s review its key features. Why should you use Azure DevOps? Here are some standout features:
- Collaboration: Azure DevOps brings your team together with shared repositories, boards, and pipelines, bringing everyone together seamlessly on various projects.
- Version control: Azure DevOps supports Git, so you and your team can monitor every change. Thanks to this, your team can manage to pull and merge requests, monitor changes, and more.
- Automated workflows: Use Azure DevOps to automate builds, tests, and deployments to ensure quicker, more dependable deployments while saving time and minimizing errors.
- Scalability: Azure DevOps is so scalable it can expand to meet the demands and size of your team. It adjusts to accommodate more users and projects, regardless of how big or small your team is.
- Integration: Azure DevOps integrates seamlessly with Azure, GitHub, and other cloud platforms and tools for a smooth workflow while ensuring secure repositories and role-based access controls.
In my experience, Azure DevOps is the go-to solution for companies and individuals wishing to implement the best DevOps practices. Why? It builds a culture of continuous growth and collaboration and provides tools.
Are you a DevOps beginner? Explore key concepts that drive modern software development and deployment in the DevOps Concepts course.
Become Azure AZ-900 Certified
Setting Up Your Azure DevOps Environment
To access the Azure DevOps environment, you must first set up everything to foster team collaboration and end-to-end development process.
Creating an Azure DevOps account
You'll need to create an account before using Azure DevOps. Here’s how you can get started:
- Visit the Azure DevOps Website: Head to Azure DevOps to begin the sign-up process. Click Get Started with Azure.
- Sign in with your Microsoft account: If you already have a Microsoft account (e.g., Outlook, Xbox, Office 365), you can use it to sign in. If not, you’ll need to create a free Microsoft account.
- Click Sign in or Create one! (Sign up).
- Use your Microsoft credentials or other sign-in options to log in.
- Click Next.
- Start the setup process: Click the Checkbox and Continue. You will be asked to create a new organization after logging in. Your Azure DevOps teams and projects will be housed within this organization.
Creating an organization in Azure DevOps
An organization in Azure DevOps is where all your projects and repositories live. This is also where you manage your teams, permissions, and billing.
- Name your organization: Pick a unique name for your organization. This is important because it will appear as part of your Azure DevOps URL (e.g.,
https://dev.azure.com/yourorganization
). - Choose your region: Azure DevOps requires selecting a region where your data will be stored. The default region should work for most, but if you have specific requirements, like complaints, you can choose another region closer to your user base (e.g., the United States).
- Confirm and continue: After filling in these details, click Continue. Your organization is now ready to go, and you'll be directed to the main Azure DevOps portal!
Exploring the Azure DevOps interface
After creating your organization, you’ll be taken to the Azure DevOps portal. The main sections of the services are the Overview, Boards, Repos, Pipelines, Test Plans, and Artifacts.
This user interface might feel overwhelming at first, but the core functions of Azure DevOps can be boiled down to version control, CI/CD, and project management.
Creating a new project
Now that your account and organization are set up let’s create your first project for Azure DevOps.
Setting up a new project
- Click on "New Project": In the Azure DevOps portal, click the New Project button. This will allow you to set up your first project.
- Fill in project details:
- Project name: Choose a name for your project (e.g., “yourproject”).
- Description (Optional): Briefly describe what this project is about.
- Visibility: Choose whether you want your project to be public or private. Anyone can view public projects, making it an excellent choice for open-source projects. Private projects are secured and only accessible to those you invite to the project.
- Create the project: After entering your project details and selecting the version control system, click Create project. Your project is now set up and ready to go!
- Version control system: Azure DevOps offers two types of version control systems: Git and Team Foundation Version Control (TFVC).
- Git is a distributed version control system that’s more modern and widely used in the developer community. It’s the best choice for most projects.
- TFVC is a centralized version control system, but it’s less common and often used in legacy projects.
In my experience, I will advise you to choose Git if you're just starting or don’t have a specific reason for choosing TFVC.
Ready to take control of your code? Learn Git and start managing your projects like a pro.
Using Azure Repos for Version Control
Now that you have your project all set, let’s look deep into it and explore some of its key features.
Setting up a Git repository
- Navigate to Repos: From the menu on the left, select the Repos tab. You will manage your code here.
- Clone the repository: You can clone the repository to your local computer using the URL in the Repos section. e.g.
# This command clones the specified Git repository from Azure DevOps to your local machine.
git clone https://yourorganization@dev.azure.com/yourorganization/yourproject/_git/yourrepo
Let’s break the command above into chunks:
- Replace
yourorganization
with your organization’s name. - Replace
yourproject
with your project’s name. - Replace
yourrepo
with your repository’s name.
Below is the URL in my Repos section:
- Push your code: Once your repository is cloned locally, you can add your code and push it back to Azure DevOps.
git add .
git commit -m "my first commit"
git push origin main
Congratulations! You’ve just made your first commit in Azure Repos.
Branching and merging
In software development, branching allows you to work on features or fixes separately from the main project. Merging is the process of bringing your changes from one branch into another.
- Create a branch locally: To start working on a feature, create a new branch:
git checkout -b feature-branch
- Push the branch to Azure DevOps: After making changes in your new branch, push it to Azure DevOps:
git push origin feature-branch
Switching between branches
To switch between branches, use the following command:
git checkout main
Or to switch to a different branch:
git checkout feature-branch
Deleting a branch
Once a feature is merged, you can delete the branch both locally and remotely:
- To delete the local branch:
git branch -d feature-branch
- To delete the remote branch:
git push origin --delete feature-branch
Merging branches via pull requests
- Create a pull request: Once your feature branch is set to be merged with the main branch, go to the Pull Requests section in Azure DevOps and click on New Pull Request.
- Review and merge: Review the changes and click Complete to merge the changes into the main branch.
- Resolve conflicts: If there are any merge conflicts (i.e., changes in the same part of the code), you’ll need to resolve them manually. Azure DevOps will help guide you through this process by highlighting the conflicting areas.
Managing pull requests
Pull requests are essential for code review and collaboration. They allow team members to review code before it’s merged into the main branch.
Creating a pull request
- Create the pull request: After pushing your feature branch, navigate to Pull Requests and click on New Pull Request. Choose the source branch (e.g.,
feature-branch
) and the target branch (e.g.,main
). - Describe the pull request: Provide a clear description of what changes are included in the pull request. This helps reviewers understand what to look for.
Reviewing and approving pull requests
- Request reviews: Add reviewers from your team who will review the code changes.
- Approve and merge: Once the pull request is approved, click Complete to merge it into the main branch.
Creating and Managing CI/CD Pipelines
Azure DevOps also includes Pipelines to automate the build, test, and deployment process.
What is a pipeline in Azure DevOps?
A pipeline in Azure DevOps is a collection of automated processes that help you:
- Build your code (build pipeline)
- Test it
- Deploy it to different environments (release pipeline)
These pipelines ensure your code is always ready for deployment and can be automatically tested.
Creating a build pipeline
- Navigate to Pipelines: In your Azure DevOps project, click New Pipeline in the Pipelines section.
- Choose a source: Select Azure Repos Git as the source and choose your repository.
- Configure the pipeline: You can configure your pipeline using either the YAML editor or Classic editor. Let’s go with YAML, a code-based way of defining the pipeline.
Let’s take a basic Node.js application as an example. Our azure-pipelines.yml
file below contains the YAML code that Azure DevOps automatically created.
# Node.js
# Build a general Node.js project with npm.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript
trigger:
- main
pool:
vmImage: ubuntu-latest
steps:
- task: NodeTool@0
inputs:
versionSpec: '20.x'
displayName: 'Install Node.js'
- script: |
npm install
npm run build
displayName: 'npm install and build'
- Save and run: Save the pipeline and run it to see if everything works correctly.
Running the build pipeline
Once your build pipeline is set up, you can run it manually by clicking Run Pipeline. The pipeline will go through different stages, such as “installing dependencies,” “running tests,” and “building.”
You can check the logs for each step to troubleshoot any failed builds. Azure DevOps provides detailed logs to help you determine what went wrong.
Setting up continuous deployment (CD)
- Navigate to Releases: Under the Pipelines section, click on Releases and then New Pipeline.
- Add an Artifact: Link the artifact from your build pipeline as the source for the release pipeline.
- Deploy to Environments: Set up environments like Staging and Production where you want your application to be deployed.
Automate deployments
Azure DevOps can automatically deploy your application whenever a new build is triggered. You can set this up by adding triggers and defining tasks to deploy to platforms like Azure, AWS, etc.
Managing Work Items with Azure Boards
Azure Boards is the heart of project management in Azure DevOps. It helps teams plan, track, and discuss work across the software development lifecycle through features like Tasks, Bugs, User Stories, and Epics.
Whether following Scrum or Kanban, Azure Boards lets you visualize, prioritize, and manage your work efficiently.
Let’s break it down step by step.
Creating and managing work items
Azure Boards allows you to manage tasks, bugs, and features using work items.
- Create a work item: Go to Boards, select Work items, and click New Work Item.
You can create:
- Epic: A large project or extensive work covering multiple smaller pieces.
- Issue: A specific problem or bug that needs fixing.
- Task: A single, actionable piece of work to be done.
- Let’s select Epic.
- Input a Title, Description, Priority, Start Date, and Target Date. Click on Save.
- Assign work items
- Open the work item you just created.
- In the Assign people field, select a team member.
- Select Add tag for better categorization. Click on Save.
- Track progress
- Use the State field to update the status (e.g., New, Active, Resolved, Closed).
- Add comments or attachments to provide updates or context.
In my experience, teams remain accountable and focused when clear owners are assigned and reasonable deadlines are specified.
Setting up sprints and backlogs
Agile sprints and backlogs are essential for iterative development. Here’s how to set them up:
- Create Sprints: Sprints are time-bound iterations of work. You can set up sprints by going to Boards > Sprints and adding new sprints (e.g., “Sprint 1”).
- Click Configure Team Settings and define your sprint duration (e.g., 2 weeks).
- Add start and end dates for the sprint.
- Manage product backlogs: In the Backlog view, you can organize your work items into priorities. Navigate to Boards > Backlogs.
- Drag and drop work items into the backlog to prioritize them.
- Visualize progress: Azure DevOps helps you visualize work items and move them across stages (e.g., To Do, Doing, Done). Use the Board view to see work items in columns.
- Customize columns to match your team’s workflow.
In my experience, following this gives your team less downtime and confusion if your backlog is well-organized and clear about what needs to be done next.
Linking work items to commits
Linking work items to commits helps track the code changes to each task or bug. Here’s how:
- Link to a commit: This can be done in two ways: via your Azure DevOps console or your local development environment.
- Azure DevOps console: In your Git commit message, include the
#WorkItemID
(e.g.,#1
). Click Commit. Azure DevOps automatically links the commit to the work item.
- Local development environment:
- In your local development environment, open the terminal or command prompt. Make your code changes and prepare to commit them.
- In the commit message, include the work item ID with a hashtag (e.g.,
Fixed bug in login analytics #1
). - Complete the commit by running the appropriate command:
git commit -m "Fixed bug in login analytics #1"
- Push the commit to the remote repository (Azure Repo):
git push origin feature-branch
- Link to a pull request:
- When creating a pull request, mention the work item ID in the Description.
- Click Create. Azure DevOps will automatically link the pull request to the work item.
In my experience, this linkage provides full traceability, making it easy to see which code changes addressed specific tasks or bugs. Remember, you can see linked commits and PRs in the Development section of the work item.
Cloud Courses
Integrating with Other Tools
Azure DevOps shines when integrated with other tools like GitHub and cloud platforms. Let’s explore how to set this up.
Integrating Azure DevOps with GitHub
Connecting Azure DevOps to GitHub streamlines collaboration and CI/CD automation. Here’s how:
- Connect GitHub to Azure Pipelines:
- Go to Pipelines > Create Pipeline.
- Select GitHub as the source.
- Authorize Azure DevOps to access your GitHub repositories.
New to GitHub? Discover how to collaborate, track changes, and contribute to open-source projects with the GitHub concepts course.
- Set up a pipeline
- Choose a repository and configure your YAML pipeline file.
- Define build and deployment steps. Example YAML:
# Set up the trigger for the pipeline
trigger:
# Specify the branches to include
branches:
include:
# Include the main branch
- main
# Define the jobs for the pipeline
jobs:
# Create a job named 'Build'
- job: Build
# List the steps for the 'Build' job
steps:
# Add a script step to print a message
- script: echo "Building the project..."
In my experience, this integration automatically ensures seamless code updates and deployments, reducing manual effort.
Connecting Azure DevOps to Azure and other cloud platforms
Azure DevOps integrates natively with Azure services like Azure Web Apps, Azure Kubernetes Services (AKS), and many more. Let’s learn how to connect our Azure DevOps to Azure Web Apps.
- Link to Azure Services:
- At the bottom left of your project, go to Project Settings and click Service Connections under the Pipelines section.
-
- Click New Service Connection and choose Azure Resource Manager.
-
- Authenticate with your Azure account.
- Deploy to Azure
- Go back to your Pipelines and configure your pipeline.
- In your pipeline, add a task to deploy to Azure.
- Specify the resource group and service details. Example Task YAML:
# Define the task for deploying to an Azure Web App
- task: AzureWebApp@1
inputs:
# Specify your Azure subscription service connection
azureSubscription: 'Your-Service-Connection'
# Specify the name of your web app
appName: 'Your-Web-App'
Let’s break the command above into chunks:
- Replace
Your-Service-Connection
with the name of the service connection with access to your Azure subscription. - Replace
Your-Web-App
with the actual name of your web app in Azure.
In my experience, this connection makes deployments easy, allowing you to focus mainly on building excellent software.
Monitoring and Reporting in Azure DevOps
Monitoring and reporting are key processes for maintaining your project's health in Azure DevOps. Let’s explore how to carry this out effectively.
Viewing pipeline metrics
Pipeline metrics shed light on the performance of builds and deployments. This is how to get to them.
- Monitor pipeline health
- Go to Pipelines > Analytics.
- View metrics like pipeline pass rate, test pass rate, and pipeline duration.
- Identify bottlenecks
- To find failure stages and slow builds, use the Pipeline Runs report.
-
- Navigate to your Azure DevOps Organization Settings > Pipelines > Parallel jobs to use parallelized jobs to improve performance and optimize tasks.
In my experience, caching dependencies, splitting jobs, and optimizing pipeline structure can significantly reduce build times and failure rates.
Using Azure DevOps reports
Azure DevOps offers robust reporting tools to track team productivity and project progress.
- Access reports
- Go to Analytics > Reports.
- Choose from pre-built reports like Cumulative Flow Diagram, Velocity, or Burndown.
- Customize reports
- Use Power BI to create custom dashboards. To do this, use the Power BI Data Connector, navigate to Power BI Online, and log in to your account.
- Click the Home icon in the top left corner, then select Get Data from the ribbon.
- You'll see a list of data sources in the Get Data window. Select Online Services > Azure DevOps (Boards only) as your data connector.
- Enter your account details, such as your Organization and Team project names, to sync your data.
- Export data for further analysis.
In my experience, you can make data-driven decisions with these analytics reports, which offer practical insights.
Best Practices for Azure DevOps
Now that we’ve learned about the core services of Azure DevOps and many more, let’s look at how to get the most out of Azure DevOps by following these best practices.
Version control best practices
- Use branch strategies
- By Adopting Git Flow or GitHub Flow for branching.
- Always keep the
main
branch stable and use feature branches for development. - Write clear commit messages
- Use the format:
type(scope): description
(e.g.,feat(login): add user authentication
). - Review pull requests
- Require at least one reviewer before merging your pull requests.
- Use comments to suggest improvements.
A clean and reusable codebase results from good version control practices.
Optimizing pipelines
- Use Cache Dependencies: Repeating downloading the same dependencies can waste significant time working with package managers. Azure DevOps supports caching mechanisms, such as the Cache task, which allows you to cache dependencies between pipeline runs.
Example cache task YAML:
# Define the cache task
- task: Cache@2
inputs:
# Set the cache key using npm, the OS, and package-lock.json
key: 'npm | "$(Agent.OS)" | package-lock.json'
# Specify the path to the node_modules directory
path: 'node_modules'
- Split jobs: Break up giant jobs into smaller, parallel tasks. Consider a huge workload that requires a lot of time to finish. By breaking it up into separate tasks, you can execute it concurrently, which speeds up the operation as a whole.
Example jobs YAML:
jobs:
# Define the first build job
- job: BuildJob1
displayName: 'Build Job 1'
pool:
vmImage: 'ubuntu-latest'
steps:
# Add a script step to print a message for Building Project A
- script: echo "Building Project A"
displayName: 'Build Project A'
# Define the second build job
- job: BuildJob2
displayName: 'Build Job 2'
pool:
vmImage: 'ubuntu-latest'
steps:
# Add a script step to print a message for Building Project B
- script: echo "Building Project B"
displayName: 'Build Project B'
# Define the test job
- job: TestJob
displayName: 'Run Tests'
# Specify that this job depends on the completion of BuildJob1 and BuildJob2
dependsOn:
- BuildJob1
- BuildJob2
pool:
vmImage: 'ubuntu-latest'
steps:
# Add a script step to print a message for Running Tests
- script: echo "Running Tests"
displayName: 'Run Tests'
- Use templates: Create reusable pipeline templates for everyday tasks. By doing this, you don’t have to rewrite the same code repeatedly. Let's create a simple template for a build task:
Example template YAML:
# Define parameters for the pipeline
parameters:
# Specify a parameter for the build configuration
- name: buildConfiguration
type: string
default: 'Release'
# List the steps for the pipeline
steps:
# Add a task to run the .NET Core CLI
- task: DotNetCoreCLI@2
inputs:
# Set the command to 'build'
command: 'build'
# Pass the build configuration as an argument
arguments: '--configuration $(buildConfiguration)'
I've found that pipeline optimization consistently results in time and resource savings.
Managing secrets and security
- Use Azure Key Vault: Store sensitive information like API keys in Azure Key Vault. To do this, go to the Azure Portal, create a new Key Vault, and add your secrets (e.g., API keys).
- Go back to Azure DevOps and create a service connection to your Azure subscription so your pipeline can access the Key Vault.
- Go to Pipelines > Library in Azure DevOps and create a new variable group.
- Link the variable group to your Key Vault to automatically fetch the secrets.
- Reference secrets in your pipelines using variable groups. Example YAML:
# azure-pipelines.yml
trigger:
- main
variables:
- group: my-variable-group # Reference the variable group that links to the Key Vault
jobs:
- job: BuildJob
pool:
vmImage: 'ubuntu-latest'
steps:
- script: echo "Using secret from Key Vault."
env:
MY_API_KEY: $(my-secret) # Reference the secret from the variable group
displayName: 'Print Secret'
From the example above: The my-variable-group
variable group is referenced, which contains secrets from the Key Vault. The script step echoes a message, using the variable group's secret $(my-secret)
as an environment variable.
- Restrict Permissions
- Always remember to limit access to pipelines and repositories based on roles.
One essential practice in modern software development is Security. Security is non-negotiable and can’t be compromised because of the consequences at stake.
Conclusion
This tutorial taught us how to set up an Azure DevOps environment, use Azure Repos for version control, create and manage CI/CD pipelines, track and manage work items with Azure Boards, integrate Azure DevOps with other tools, best practices for Azure DevOps, and more.
Consistency is the secret to success. Review your processes frequently, get feedback, and make adjustments. Mastering these can unlock your full potential as a data professional in software development. Explore Azure DevOps, try out these tools, and see how much more productive your team is.
To dive deeper into Microsoft Azure, check out the following courses:
- Understanding Microsoft Azure – Build a strong foundation in Microsoft Azure and unlock the power of cloud computing.
- Microsoft Azure Fundamentals (AZ-900) – Get exam-ready with this beginner-friendly track covering all key Azure fundamentals.
- Understanding Microsoft Azure Architecture and Services – Learn how Azure’s architecture and services work together to power cloud solutions.
Become Azure AZ-900 Certified
Emmanuel Akor is a Cloud & DevOps Engineer skilled in leveraging cloud technologies and DevOps tools to drive impactful projects. A First-Class Computer Science graduate from Babcock University and former Cloud Co-Lead for GDSC, Emmanuel combines academic excellence with hands-on experience. As a Technical Content Writer, he excels at sharing knowledge and collaborating with teams.
Learn more about Azure with these courses!
course
Understanding Microsoft Azure Architecture and Services
track
Microsoft Azure Fundamentals (AZ-900)
blog
How to Learn Azure: A Beginner’s Guide to Microsoft’s Cloud Platform

Josep Ferrer
14 min
blog
CI/CD in Data Engineering: A Guide for Seamless Deployment

Jake Roach
12 min
tutorial
Kubernetes Tutorial: A Beginner Guide to Deploying Applications

Patrick Brus
25 min
tutorial
Azure Data Factory: A Complete Guide for Beginners
tutorial
Azure Storage Accounts: Step-by-Step Tutorial for Beginners

Anneleen Rummens
20 min
tutorial