Understanding the Classic Editor for Azure Pipelines

Azure DevOps offers two primary ways to define your build and release pipelines: the YAML editor and the Classic editor. While YAML pipelines are the recommended approach for modern CI/CD practices due to their code-based nature and version control benefits, the Classic editor remains a valuable tool, especially for those familiar with it or for specific scenarios. This tutorial will guide you through the features and functionalities of the Classic editor.

What is the Classic Editor?

The Classic editor is a graphical user interface (GUI) that allows you to visually design and configure your build and release pipelines. It uses a task-based approach, where you select pre-defined tasks from a catalog and configure their inputs and outputs to orchestrate your CI/CD process.

Key Components of the Classic Editor

When you create or edit a pipeline in the Classic editor, you'll encounter several key areas:

1. Pipeline Designer Canvas

This is the main workspace where you assemble your pipeline. It consists of agents, stages, jobs, and tasks. You drag and drop tasks or select them from the available list to build your workflow.

2. Task Catalog

A comprehensive list of available tasks for building, testing, deploying, and managing your code. Tasks are categorized by source control, build, test, deploy, package, and utility.

3. Task Configuration Pane

When you select a task on the canvas, this pane appears, allowing you to configure its specific settings, such as script paths, arguments, service connections, and variables.

4. Variables

Define and manage variables that can be used throughout your pipeline to parameterize tasks and configurations. This is crucial for making your pipelines reusable and adaptable.


# Example of how variables might be used
- task: AzureWebApp@1
  inputs:
    azureSubscription: $(azureServiceConnection)
    appName: $(webAppName)
    package: '$(Pipeline.Workspace)/drop/**/*.zip'
            

5. Triggers

Configure what initiates your pipeline, such as code commits to specific branches (CI triggers) or scheduled runs.

6. Options

Control pipeline behavior, including agent pools, build retention policies, and artifact management.

Creating a Build Pipeline with the Classic Editor

Let's walk through a simple example of creating a build pipeline:

  1. Navigate to your Azure DevOps project and select "Pipelines" > "Pipelines".
  2. Click "New pipeline".
  3. Select "Use the classic editor" at the bottom of the page.
  4. Choose your repository and branch.
  5. Select a starter pipeline template or choose "Empty job".
  6. In the "Agent job" section, select an appropriate agent pool.
  7. Click the "+" button on the Agent job to add tasks.
  8. Search for and add tasks like "Checkout Sources", "Build solution", "Publish build artifacts", etc.
  9. Configure each task's inputs and outputs.
  10. Save and queue your pipeline.

Creating a Release Pipeline with the Classic Editor

Release pipelines in the Classic editor are designed to automate the deployment of your built artifacts to various environments.

  1. Navigate to "Pipelines" > "Releases".
  2. Click "New pipeline".
  3. Select a template or choose "Empty job".
  4. Add an artifact, linking it to your build pipeline's output.
  5. Define stages (e.g., Development, Staging, Production) and configure them with deployment tasks.
  6. Tasks within a stage might include "Azure App Service deploy", "Run PowerShell on target machines", etc.
  7. Configure triggers (e.g., Continuous deployment) and pre-deployment approvals.
  8. Save and create a release.

When to Use the Classic Editor

Transitioning to YAML

While the Classic editor is functional, Microsoft strongly recommends migrating to YAML pipelines. YAML pipelines offer:

You can often export an existing Classic pipeline as YAML to help with this transition.

By understanding the Classic editor, you can effectively manage and maintain your existing CI/CD infrastructure in Azure DevOps while planning for a potential migration to more modern YAML-based pipelines.