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
- Azure Boards: Agile planning tools (Kanban boards, backlogs, team dashboards) for project management.
- Azure Repos: Git repositories for source control.
- Azure Pipelines: Continuous integration and continuous delivery (CI/CD) pipelines.
- Azure Test Plans: Tools for manual and exploratory testing.
- 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
- Go to the Azure DevOps portal.
- Sign in with your Microsoft account.
- Click on "New organization".
- Follow the prompts to create your organization.
Step 2: Create a Project
- In your Azure DevOps organization, click on "New Project".
- Enter a project name and description.
- Choose the visibility (public or private).
- Select the version control (Git or Team Foundation Version Control).
- Choose the work item process (Agile, Scrum, CMMI).
- 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
- Navigate to your Azure DevOps project.
- Click on "Pipelines" in the left-hand menu.
- Click "New pipeline".
- Select the source where your code is stored (e.g., GitHub, Azure Repos).
Step 2: Configure the Pipeline
- Choose a template or start with an empty pipeline.
- Define the pipeline using YAML or the classic editor.
- Specify the build steps (e.g., install dependencies, run tests, build the application).
- 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
- Save and run the pipeline.
- Monitor the pipeline's progress in the Azure DevOps portal.
- Review the build and deployment logs for any issues.
Exercises
Exercise 1: Create a New Azure DevOps Project
- Create a new Azure DevOps organization.
- Create a new project within the organization.
- Set up a Git repository in the project.
Exercise 2: Set Up a CI/CD Pipeline
- Create a new pipeline in your Azure DevOps project.
- Configure the pipeline to build and deploy a simple Node.js application.
- Run the pipeline and verify the deployment.
Solutions
Solution to Exercise 1
- Follow the steps outlined in the "Setting Up Azure DevOps" section to create a new organization and project.
- Navigate to "Repos" and initialize a new Git repository.
Solution to Exercise 2
- Follow the steps in the "Practical Example: Setting Up a CI/CD Pipeline" section to create and configure a new pipeline.
- Use the provided YAML example to set up the pipeline for a Node.js application.
- 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.