What is Azure DevOps?

Azure DevOps is a suite of development tools provided by Microsoft to support the entire software development lifecycle. It includes services for planning, developing, delivering, and operating applications. Azure DevOps provides a set of cloud-hosted services that can be used together or independently, depending on your needs.

Key Components of Azure DevOps

  1. Azure Boards: Agile planning tools (Kanban boards, backlogs, team dashboards) for project management.
  2. Azure Repos: Git repositories for source control.
  3. Azure Pipelines: Continuous integration and continuous delivery (CI/CD) pipelines.
  4. Azure Test Plans: Tools for manual and exploratory testing.
  5. Azure Artifacts: Package management for Maven, npm, NuGet, and more.

Why Use Azure DevOps?

  • Integration: Seamlessly integrates with other Azure services and third-party tools.
  • Scalability: Scales from small teams to large enterprises.
  • Flexibility: Supports various development methodologies (Agile, Scrum, Kanban).
  • Collaboration: Enhances collaboration among team members with integrated tools.
  • Automation: Automates the build, test, and deployment processes.

Setting Up Azure DevOps

Step 1: Create an Azure DevOps Organization

  1. Go to the Azure DevOps portal.
  2. Sign in with your Microsoft account.
  3. Click on "New organization".
  4. Follow the prompts to create your organization.

Step 2: Create a Project

  1. In your Azure DevOps organization, click on "New Project".
  2. Enter a project name and description.
  3. Choose the visibility (public or private).
  4. Select the version control (Git or Team Foundation Version Control).
  5. Choose the work item process (Agile, Scrum, CMMI).
  6. Click "Create".

Overview of Azure DevOps Services

Azure Boards

Azure Boards provides a rich set of capabilities including:

  • Work Items: Track tasks, bugs, features, and other work.
  • Backlogs: Organize and prioritize work.
  • Sprints: Plan and manage iterations.
  • Dashboards: Visualize project status and progress.

Azure Repos

Azure Repos offers:

  • Git Repositories: Unlimited private Git repositories.
  • Pull Requests: Code review and collaboration.
  • Branch Policies: Enforce best practices with branch policies.
  • Code Search: Search across your codebase.

Azure Pipelines

Azure Pipelines supports:

  • CI/CD: Automate builds and deployments.
  • Multi-platform: Build and deploy on any platform (Windows, Linux, macOS).
  • Integration: Integrates with GitHub, Bitbucket, and other repositories.
  • Templates: Use predefined templates for common tasks.

Azure Test Plans

Azure Test Plans includes:

  • Manual Testing: Create and run manual tests.
  • Exploratory Testing: Perform exploratory testing sessions.
  • Test Suites: Organize tests into test plans and test suites.
  • Test Reporting: Generate detailed test reports.

Azure Artifacts

Azure Artifacts provides:

  • Package Management: Host and share packages with your team.
  • Support for Multiple Feeds: Create multiple feeds to organize packages.
  • Integration: Integrates with Azure Pipelines for CI/CD.

Practical Example: Setting Up a CI/CD Pipeline

Step 1: Create a New Pipeline

  1. Navigate to your Azure DevOps project.
  2. Click on "Pipelines" in the left-hand menu.
  3. Click "New pipeline".
  4. Select the source where your code is stored (e.g., GitHub, Azure Repos).

Step 2: Configure the Pipeline

  1. Choose a template or start with an empty pipeline.
  2. Define the pipeline using YAML or the classic editor.
  3. Specify the build steps (e.g., install dependencies, run tests, build the application).
  4. Define the deployment steps (e.g., deploy to Azure App Service).

Example YAML Pipeline

trigger:
- main

pool:
  vmImage: 'ubuntu-latest'

steps:
- task: UseNode@2
  inputs:
    versionSpec: '14.x'
  displayName: 'Install Node.js'

- script: |
    npm install
    npm run build
  displayName: 'Install dependencies and build'

- task: ArchiveFiles@2
  inputs:
    rootFolderOrFile: '$(Build.SourcesDirectory)/dist'
    includeRootFolder: false
    archiveType: 'zip'
    archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip'
    replaceExistingArchive: true
  displayName: 'Archive build output'

- task: PublishBuildArtifacts@1
  inputs:
    PathtoPublish: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip'
    ArtifactName: 'drop'
  displayName: 'Publish build artifacts'

Step 3: Run the Pipeline

  1. Save and run the pipeline.
  2. Monitor the pipeline's progress in the Azure DevOps portal.
  3. Review the build and deployment logs for any issues.

Exercises

Exercise 1: Create a New Azure DevOps Project

  1. Create a new Azure DevOps organization.
  2. Create a new project within the organization.
  3. Set up a Git repository in the project.

Exercise 2: Set Up a CI/CD Pipeline

  1. Create a new pipeline in your Azure DevOps project.
  2. Configure the pipeline to build and deploy a simple Node.js application.
  3. Run the pipeline and verify the deployment.

Solutions

Solution to Exercise 1

  1. Follow the steps outlined in the "Setting Up Azure DevOps" section to create a new organization and project.
  2. Navigate to "Repos" and initialize a new Git repository.

Solution to Exercise 2

  1. Follow the steps in the "Practical Example: Setting Up a CI/CD Pipeline" section to create and configure a new pipeline.
  2. Use the provided YAML example to set up the pipeline for a Node.js application.
  3. Run the pipeline and check the deployment logs to ensure everything is working correctly.

Conclusion

In this module, you learned about the key components and benefits of Azure DevOps. You also set up a new Azure DevOps project and created a CI/CD pipeline. These foundational skills will help you manage and automate your software development processes effectively. In the next module, we will dive deeper into Azure Pipelines and explore advanced CI/CD scenarios.

© Copyright 2024. All rights reserved