Skip to main content

Azure DevOps Tutorial: Build, Test, and Deploy Applications

This tutorial walks you through Azure DevOps, making CI/CD easier than ever.
Mar 11, 2025  · 15 min read

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.

This is the Azure DevOps interface showcasing the main console of a project overview. The screen displays various tabs and options such as Boards, Repos, Pipelines, and Artifacts. You can see a summary of the project's activities, including recent commits, work items, and pipeline runs. The intuitive layout helps you navigate and manage different aspects of the project efficiently.

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

Prepare for Azure's PL-300 and get 50% off the exam fee.
Certify Your Azure Skills

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.

This is the Azure DevOps website interface that helps you get started with Azure DevOps.

  • 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.

Sign in to your Microsoft account to get started.

Click the "Sign In" button, or select "Create one!" if you need to sign up for a new account.

Enter your Microsoft credentials or choose another sign-in option to log in.

Finally, click "Next" to proceed.

  • 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. 

Begin the setup process by following these steps:

Click the checkbox to agree to the terms.

Then, click "Continue" to move forward.

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!

Creating an organization in Azure DevOps is easy. Follow these steps:

Enter a name for your new organization.

Select your preferred region to host the organization.

Confirm your choices and click "Continue" to finalize the setup.

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.

Exploring the Azure DevOps interface is easy after creating your organization.

You’ll be taken to the Azure DevOps portal, where you'll see different sections like Overview, Boards, Repos, Pipelines, Test Plans, and Artifacts.

These sections help you navigate and manage your projects efficiently.

The Overview provides a summary, Boards handle work items, Repos store code, Pipelines automate builds and deployments, Test Plans manage testing, and Artifacts handle package management.

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!

Setting up a new project in Azure DevOps is straightforward:

Enter the project details, including the project name, a brief description, and set the visibility (public or private).

Finally, click "Create the Project" to get started.

  • 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.

Choosing a version control system in Azure DevOps is essential for managing your code. Here are two options:

Git: A distributed version control system that is modern and widely used in the developer community. It's the best choice for most projects.

TFVC (Team Foundation Version Control): A centralized version control system, less common and often used in legacy projects.

This intuitive layout helps you decide which system best fits your project's needs.

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.

Using Azure Repos for Version Control is easy. Here's how to set up a Git repository:

Navigate to Repos: From the menu on the left, click on the "Repos" tab.

Manage Your Code: This section is where you will manage and organize your code.

This user-friendly interface ensures a smooth experience for managing version control in your projects.

  • 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:

Clone your repository to your computer or local machine to start working with your code locally.

This command downloads a copy of the repository from Azure DevOps to your local machine, allowing you to manage and update your code efficiently.

  • 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.

Create a pull request easily:

Once your feature branch is ready to be merged with the main branch, navigate to the Pull Requests section in Azure DevOps.

Click on New Pull Request to start the merging process.

This intuitive interface ensures a smooth process for merging your code changes.

  • 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 a Pull Request in Azure DevOps:

Create the Pull Request: Push your feature branch, go to Pull Requests, click on New Pull Request. Choose source (e.g., feature-branch) and target (e.g., main) branches.

Describe the Pull Request: Clearly explain the changes to help reviewers understand.

Request Reviews: Add team reviewers to check the code.

Approve and Merge: Once approved, click Complete to merge 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.

Navigate to the Pipelines section within your Azure DevOps project:

Open your Azure DevOps project.

In the left-hand menu, click on Pipelines.

This section allows you to manage your build and release pipelines efficiently.

To navigate to Pipelines in your Azure DevOps project:

Open your Azure DevOps project.

Click on the Pipelines tab from the left-hand menu.

Click on New Pipeline in the Pipelines section to create a new one.

This simple process helps you manage and automate your build and release workflows efficiently.

  • Choose a source: Select Azure Repos Git as the source and choose your repository.

Choose a source for your pipeline:

Select Azure Repos Git as your source.

Then, choose the repository you want to work with.

This simple process ensures you connect the correct code repository to your pipeline for efficient management.

  • 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.

To navigate to Releases in Azure DevOps:

Go to the Pipelines section from the left-hand menu.

Click on Releases.

This user-friendly interface helps you efficiently manage your release pipelines.

Creating a release pipeline in Azure DevOps is straightforward:

Navigate to the Pipelines section from the left-hand menu.

Click on Releases.

Then, select New Pipeline to start setting up your release process.

This user-friendly interface helps you efficiently manage and automate your release workflows.

  • Add an Artifact: Link the artifact from your build pipeline as the source for the release pipeline.

Add an artifact to your release pipeline:

In the release pipeline setup, navigate to the Add an artifact section.

Link the artifact from your build pipeline as the source for your release pipeline.

This ensures the build outputs are available for the release process, making it easy to manage and deploy your application.

  • Deploy to Environments: Set up environments like Staging and Production where you want your application to be deployed.

Deploy to different environments easily:

Set up the environments where you want your application to be deployed, such as Staging and Production.

This process helps you test and release your application efficiently, ensuring it works correctly in different scenarios before going live.

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.

Creating and Managing Work Items in Azure DevOps is straightforward:

Azure Boards: Use Azure Boards to manage tasks, bugs, and features through work items.

Create a Work Item: Navigate to Boards, select Work items, and click on New Work Item.

This user-friendly interface helps you efficiently manage and track your project's tasks and issues.

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.

From the drop-down menu of "New Work Item", you can create the following:

Epic: A large project or extensive work that covers multiple smaller pieces.

Issue: A specific problem or bug that needs fixing.

Task: A single, actionable piece of work to be completed.

This simple process helps you effectively manage different aspects of your project within Azure Boards.

  • Let’s select Epic
    • Input a Title, Description, Priority, Start Date, and Target Date. Click on Save.

Let's create an Epic work item:

Select Epic from the drop-down menu.

Fill in the details: Title, Description, Priority, Start Date, and Target Date.

Click on Save to finalize the creation.

This helps you manage and track large projects efficiently within Azure DevOps.

  • 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.

Assign work items easily:

Open the work item you just created.

In the "Assign people" field, select a team member.

Optionally, select "Add tag" for better categorization.

Click on Save to finalize the assignment.

This streamlined process helps you efficiently allocate tasks and manage your project team in Azure DevOps.

  • 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”).

Setting up sprints and backlogs in Azure DevOps is crucial for agile development. Here’s how to do it:

Create Sprints: Sprints are time-bound iterations of work. Set up sprints by navigating to Boards, then selecting Sprints.

This straightforward process helps you efficiently manage iterative development and track progress in your projects.

Create Sprints and add new ones easily:

To set up a sprint, go to Boards and then Sprints.

You can add new sprints by giving them names, such as “Sprint 1”, to organize your work effectively.

This user-friendly process ensures efficient management of your iterative development cycles.

  • Click Configure Team Settings and define your sprint duration (e.g., 2 weeks).

Click on "Configure Team Settings" to customize and manage your team's preferences and settings within Azure DevOps.

This option helps you tailor the project environment to best fit your team's needs, ensuring efficient collaboration and workflow management.

Customize your settings by selecting the Backlog navigation levels and Working days:

Use the checkboxes beside these options to make your selections.

This simple process helps you tailor your project environment to suit your team's needs.

  • Add start and end dates for the sprint.

To set up your sprint, add the start and end dates:

Input the start date and end date for the sprint.

This simple process helps you efficiently plan and manage your sprints within Azure DevOps.

  • Manage product backlogs: In the Backlog view, you can organize your work items into priorities. Navigate to Boards > Backlogs

Manage product backlogs easily:

In the Backlog view, you can organize your work items by priority.

Navigate to Boards, then select Backlogs.

This user-friendly interface helps you prioritize tasks efficiently within Azure DevOps.

  • Drag and drop work items into the backlog to prioritize them. 

Prioritize work items easily:

Simply drag and drop work items into the backlog to set their priority.

This intuitive feature helps you manage and organize your tasks efficiently within Azure DevOps.

  • 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. 

Visualize your progress easily:

Azure DevOps helps you see the status of your work items and move them through different stages (e.g., To Do, Doing, Done).

Use the Board view to see work items organized in columns.

This feature helps you efficiently track and manage the progress of your tasks within Azure DevOps.

  • Customize columns to match your team’s workflow.

Configure board settings easily:

Customize your board view to suit your workflow and team needs by adjusting the settings.

This feature helps you tailor your board for efficient task management and better visualization of your project's progress.

Customize columns to align with your team’s workflow:

Adjust the columns on your board to match your team's process and work style.

This feature helps you create a more efficient and tailored workflow within Azure DevOps.

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.

Linking work items to commits:

In your Git commit message, include the #WorkItemID (e.g., #1).

Click Commit.

Azure DevOps automatically links the commit to the work item, ensuring seamless tracking and management of your code changes.

  • 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.

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, ensuring seamless tracking and management.

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

Build your Cloud skills with interactive courses, curated by real-world experts.

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

Connecting Azure DevOps to GitHub streamlines collaboration and CI/CD automation. Here’s how:

Connect GitHub to Azure Pipelines:

Navigate to the Pipelines section in Azure DevOps.

This integration makes it easier to manage your projects and automate your workflows effectively.

Click on Create Pipeline to start setting up a new pipeline.

This straightforward step helps you begin the process of automating your workflows within Azure DevOps.

  • Select GitHub as the source. 

Select GitHub as the source for your new pipeline.

This action helps you connect your GitHub repository to Azure DevOps, streamlining collaboration and automation.

  • 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. 

Set up a pipeline:

Choose a repository.

This simple process helps you get started with automating your workflows in Azure DevOps.

Set up a pipeline:

Configure your YAML pipeline file.

This simple process helps you get started with automating your workflows in Azure DevOps.

  • 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. 

Link to Azure Services:

At the bottom left of your project, navigate to Project Settings.

This step helps you connect to various Azure services, enhancing your project's capabilities and integrations.

Navigate to the Pipelines section:

Click on Service Connections under the Pipelines section.

This step helps you link to Azure Services, enhancing your project's capabilities and integrations.

    • Click New Service Connection and choose Azure Resource Manager

Set up a new service connection:

Click on New Service Connection.

This simple process helps you connect to Azure resources, enhancing your project's capabilities.

Set up a new service connection:

Choose Azure Resource Manager.

This simple process helps you connect to Azure resources, enhancing your project's capabilities.

    • 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.

Monitor pipeline health:

Go to Pipelines, then select Analytics.

View important metrics such as pipeline pass rate, test pass rate, and pipeline duration.

This feature helps you keep track of your pipeline's performance and ensure everything is running smoothly.

  • Identify bottlenecks 
    • To find failure stages and slow builds, use the Pipeline Runs report.

Identify bottlenecks:

To find failure stages and slow builds, use the Pipeline Runs report.

This helps you pinpoint issues and improve your pipeline's performance within Azure DevOps.

    • Navigate to your Azure DevOps Organization Settings > Pipelines > Parallel jobs to use parallelized jobs to improve performance and optimize tasks. 

Navigate to your Azure DevOps Organization Settings:

Go to Pipelines, then select Parallel jobs.

Using parallelized jobs helps improve performance and optimize tasks within Azure DevOps.

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.

Accessing 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.

Create custom dashboards using Power BI:

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.

In the Get Data window, select Online Services > Azure DevOps (Boards only) as your data connector.

This step-by-step process helps you efficiently create custom dashboards and visualize your data in Power BI.

  • Enter your account details, such as your Organization and Team project names, to sync your data.

Enter your account details to sync your data:

Provide your Organization and Team project names.

This helps ensure your data is accurately synced within Azure DevOps.

  • 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).

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 and create a new Key Vault.

This step helps keep your sensitive data secure and organized within Azure DevOps.

After creating a new Key Vault:

Add your secrets, such as API keys and passwords.

This step helps keep your sensitive data secure and organized within Azure DevOps.

  • Go back to Azure DevOps and create a service connection to your Azure subscription so your pipeline can access the Key Vault.

Create a service connection to your Azure subscription:

Go back to Azure DevOps.

Set up a service connection to your Azure subscription.

This step helps your pipeline access the Key Vault, enhancing security and automation in your project.

  • Go to Pipelines > Library in Azure DevOps and create a new variable group. 

Create a new variable group easily:

In Azure DevOps, navigate to Pipelines, then select Library.

Create a new variable group.

This step helps you manage and organize your variables for efficient pipeline configurations.

  • 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: 

Become Azure AZ-900 Certified

Prepare for Azure's PL-300 and get 50% off the exam fee.

Emmanuel Akor's photo
Author
Emmanuel Akor
LinkedIn
Twitter

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.

Topics

Learn more about Azure with these courses!

course

Understanding Microsoft Azure Architecture and Services

2 hr
11.8K
This course dives deeper into the Azure's backbone by going into topics like containers, virtual machines and much more.
See DetailsRight Arrow
Start Course
See MoreRight Arrow
Related

blog

How to Learn Azure: A Beginner’s Guide to Microsoft’s Cloud Platform

Discover how to learn Azure, develop essential cloud computing skills, and apply them to real-world challenges. Explore beginner-friendly resources that make mastering Azure straightforward and achievable.
Josep Ferrer's photo

Josep Ferrer

14 min

blog

CI/CD in Data Engineering: A Guide for Seamless Deployment

Learn how CI/CD is employed in Data Engineering workflows and the tools that are used to build these processes.
Jake Roach's photo

Jake Roach

12 min

tutorial

Kubernetes Tutorial: A Beginner Guide to Deploying Applications

Learn Kubernetes the hands-on way! This guide walks you through setting up a local Kubernetes cluster, deploying apps, and managing resources efficiently.
Patrick Brus's photo

Patrick Brus

25 min

tutorial

Azure Data Factory: A Complete Guide for Beginners

Learn the basics of Azure Data Factory and build your first data pipeline with this step-by-step guide!
Moez Ali's photo

Moez Ali

30 min

tutorial

Azure Storage Accounts: Step-by-Step Tutorial for Beginners

This guide teaches you how to set up and manage Azure Storage Accounts, step-by-step. It also explores advanced configuration options for optimal performance and cost optimization.
Anneleen Rummens's photo

Anneleen Rummens

20 min

tutorial

How to Set Up and Configure Azure: Beginner's Guide

Learn how to set up and configure Azure with this beginner's guide. Follow easy steps to navigate the Azure portal, create resources, and manage your cloud services.
Florin Angelescu's photo

Florin Angelescu

8 min

See MoreSee More