Convert Figma logo to code with AI

microsoft logoazure-pipelines-tasks

Tasks for Azure Pipelines

3,488
2,607
3,488
555

Top Related Projects

4,906

The GitHub ToolKit for developing GitHub Actions.

4,576

Jenkins X provides automated CI+CD for Kubernetes with Preview Environments on Pull Requests using Cloud Native pipelines from Tekton

Workflow Engine for Kubernetes

Spinnaker is an open source, multi-cloud continuous delivery platform for releasing software changes with high velocity and confidence.

Concourse is a container-based continuous thing-doer written in Go.

A cloud-native Pipeline resource.

Quick Overview

Microsoft's azure-pipelines-tasks is a repository containing a collection of tasks used in Azure Pipelines. These tasks are the building blocks of pipeline definitions, enabling various actions such as building, testing, and deploying applications. The repository serves as a central location for maintaining and updating these tasks.

Pros

  • Extensive collection of pre-built tasks for various development scenarios
  • Regular updates and maintenance by Microsoft and the community
  • Integration with Azure DevOps and other Microsoft services
  • Open-source, allowing for community contributions and customizations

Cons

  • Primarily focused on Azure and Microsoft ecosystems, potentially limiting use in other environments
  • Learning curve for understanding task structure and contribution process
  • Some tasks may have dependencies on specific Azure services or tools
  • Occasional breaking changes in task versions may require pipeline updates

Getting Started

To use Azure Pipelines tasks in your project:

  1. Create an Azure DevOps account and set up a project.
  2. In your project, create a new pipeline or edit an existing one.
  3. Add tasks to your pipeline using the YAML editor or classic interface.

Example YAML pipeline using common tasks:

trigger:
- main

pool:
  vmImage: 'ubuntu-latest'

steps:
- task: NodeTool@0
  inputs:
    versionSpec: '14.x'
  displayName: 'Install Node.js'

- task: Npm@1
  inputs:
    command: 'install'
  displayName: 'npm install'

- task: Npm@1
  inputs:
    command: 'custom'
    customCommand: 'run build'
  displayName: 'npm run build'

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

- task: PublishBuildArtifacts@1
  inputs:
    pathToPublish: '$(Build.ArtifactStagingDirectory)'
    artifactName: 'drop'

This example pipeline installs Node.js, runs npm install and build commands, archives the build output, and publishes it as an artifact.

Competitor Comparisons

4,906

The GitHub ToolKit for developing GitHub Actions.

Pros of toolkit

  • More lightweight and focused on GitHub Actions specifically
  • Easier to get started with for developers familiar with JavaScript/TypeScript
  • Better integration with GitHub's ecosystem and features

Cons of toolkit

  • Less comprehensive task coverage compared to azure-pipelines-tasks
  • May require more custom coding for complex workflows
  • Limited to GitHub Actions, while azure-pipelines-tasks works with Azure Pipelines

Code Comparison

toolkit:

import * as core from '@actions/core'
import * as github from '@actions/github'

try {
  const nameToGreet = core.getInput('who-to-greet')
  console.log(`Hello ${nameToGreet}!`)
} catch (error) {
  core.setFailed(error.message)
}

azure-pipelines-tasks:

import tl = require('azure-pipelines-task-lib/task');

async function run() {
    try {
        const inputString: string = tl.getInput('samplestring', true);
        console.log('Hello', inputString);
    } catch (err) {
        tl.setResult(tl.TaskResult.Failed, err.message);
    }
}

run();

The toolkit code is more concise and uses modern JavaScript features, while azure-pipelines-tasks uses a more traditional TypeScript approach with async/await. The toolkit also provides direct access to GitHub-specific functionality through the @actions/github package.

4,576

Jenkins X provides automated CI+CD for Kubernetes with Preview Environments on Pull Requests using Cloud Native pipelines from Tekton

Pros of jx

  • More focused on Kubernetes-native CI/CD and cloud-native applications
  • Provides a complete DevOps platform with built-in GitOps workflows
  • Offers automated environment promotion and versioning

Cons of jx

  • Steeper learning curve for teams not familiar with Kubernetes
  • Less extensive task library compared to Azure Pipelines Tasks
  • More opinionated approach, which may limit flexibility in some scenarios

Code Comparison

azure-pipelines-tasks:

- task: NuGetCommand@2
  inputs:
    restoreSolution: '**/*.sln'
- task: VSBuild@1
  inputs:
    solution: '**/*.sln'
    msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactStagingDirectory)"'
    platform: 'Any CPU'
    configuration: 'Release'

jx:

pipeline:
  agent:
    image: gcr.io/jenkinsxio/builder-go
  stages:
  - name: ci
    steps:
    - sh: make build
    - sh: make test
  - name: cd
    steps:
    - sh: jx step helm release

The Azure Pipelines Tasks example shows specific task definitions, while the jx example demonstrates a more Kubernetes-oriented pipeline structure with simpler, more generic steps.

Workflow Engine for Kubernetes

Pros of Argo Workflows

  • Cloud-native, Kubernetes-native workflow engine
  • Supports complex workflows with DAGs and step templates
  • Extensible with custom executors and plugins

Cons of Argo Workflows

  • Steeper learning curve for non-Kubernetes users
  • Requires Kubernetes cluster setup and management
  • Less integrated with cloud-specific services compared to Azure Pipelines

Code Comparison

Argo Workflows (YAML):

apiVersion: argoproj.io/v1alpha1
kind: Workflow
spec:
  entrypoint: hello-world
  templates:
  - name: hello-world
    container:
      image: docker/whalesay
      command: [cowsay]
      args: ["Hello World"]

Azure Pipelines Tasks (YAML):

steps:
- task: Docker@2
  inputs:
    containerRegistry: 'dockerHub'
    command: 'run'
    arguments: 'docker/whalesay cowsay "Hello World"'

Both examples demonstrate running a simple container task, but Argo Workflows uses Kubernetes-native concepts, while Azure Pipelines Tasks focuses on predefined tasks and integrations with Azure services.

Spinnaker is an open source, multi-cloud continuous delivery platform for releasing software changes with high velocity and confidence.

Pros of Spinnaker

  • Multi-cloud support: Spinnaker offers native integration with multiple cloud providers, allowing for more flexible deployment options
  • Advanced deployment strategies: Supports sophisticated deployment techniques like canary releases and blue/green deployments out-of-the-box
  • Extensible plugin system: Allows for easy customization and addition of new features

Cons of Spinnaker

  • Steeper learning curve: More complex setup and configuration compared to Azure Pipelines Tasks
  • Resource-intensive: Requires more infrastructure to run and maintain
  • Less integration with Microsoft ecosystem: Fewer built-in integrations with Azure services

Code Comparison

Azure Pipelines Tasks:

- task: AzureWebApp@1
  inputs:
    azureSubscription: 'Resource Manager Connection'
    appName: 'myWebApp'
    deployToSlotOrASE: true
    resourceGroupName: 'myResourceGroup'
    slotName: 'production'

Spinnaker:

{
  "type": "deployManifest",
  "account": "my-kubernetes-account",
  "cloudProvider": "kubernetes",
  "source": "text",
  "manifests": [
    {
      "apiVersion": "apps/v1",
      "kind": "Deployment",
      "metadata": {
        "name": "myapp"
      }
    }
  ]
}

Concourse is a container-based continuous thing-doer written in Go.

Pros of Concourse

  • Open-source and self-hosted, offering more control and customization
  • Pipeline-as-code approach with YAML configuration for better version control
  • Language-agnostic with support for various ecosystems and technologies

Cons of Concourse

  • Steeper learning curve compared to Azure Pipelines Tasks
  • Less integrated with cloud services and requires more setup
  • Smaller ecosystem and community support

Code Comparison

Azure Pipelines Tasks (PowerShell):

- task: AzurePowerShell@5
  inputs:
    azureSubscription: 'Resource Manager Connection'
    ScriptType: 'InlineScript'
    Inline: |
      Write-Host "Hello from Azure PowerShell"

Concourse (YAML):

jobs:
- name: hello-job
  plan:
  - task: say-hello
    config:
      platform: linux
      image_resource:
        type: docker-image
        source: {repository: alpine}
      run:
        path: echo
        args: ["Hello from Concourse"]

Summary

Azure Pipelines Tasks offers a more user-friendly experience with tighter integration to Microsoft services, while Concourse provides a flexible, open-source solution with a focus on pipeline-as-code. Azure Pipelines Tasks may be better suited for teams already using Azure DevOps, while Concourse appeals to those seeking more control and customization in their CI/CD workflows.

A cloud-native Pipeline resource.

Pros of Pipeline

  • Cloud-native and Kubernetes-native design, offering better integration with containerized environments
  • More flexible and extensible architecture, allowing for easier customization and plugin development
  • Vendor-neutral and open-source, fostering a broader community and ecosystem

Cons of Pipeline

  • Steeper learning curve due to its Kubernetes-centric approach
  • Less mature ecosystem compared to Azure Pipelines Tasks, with fewer pre-built tasks available
  • Requires more setup and configuration, especially for non-Kubernetes environments

Code Comparison

Pipeline (Tekton) task definition:

apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
  name: hello-world
spec:
  steps:
    - name: echo
      image: ubuntu
      command:
        - echo
      args:
        - "Hello World!"

Azure Pipelines Tasks definition:

steps:
- task: Bash@3
  inputs:
    targetType: 'inline'
    script: 'echo "Hello World!"'

Both examples show a simple "Hello World" task, but Pipeline's definition is more verbose and Kubernetes-oriented, while Azure Pipelines Tasks uses a more concise, platform-specific syntax.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Azure Pipelines Tasks

Tasks

Overview

This repo contains the tasks that are provided out-of-the-box with Azure Pipelines and Team Foundation Server.

This provides open examples on how we write tasks which will help you write other tasks which can be uploaded to your account or server. See Writing Tasks below. Check Deprecation.md file for the list of task which are no longer supported.

Status

Build & Test
Win WindowsBuild & Test
macOS macOSBuild & Test
Linux LinuxBuild & Test

How to Use Tasks

See the documentation for Continuous integration and deployment.

Writing Tasks

If you need custom functionality in your build/release, it is usually simpler to use the existing script running tasks such as the PowerShell or Bash tasks. Writing a new task may be appropriate if you need deeper integration or reusability in many build definitions

Tasks are simply tool runners. They know how to run MSBuild, VSTest, etc... in a first class way and handle return codes, how to treat std/err out, and how to write timeline records based on expected output. They also get access to credentials to write back to TFS/Azure Pipelines.

For uploading custom tasks to Azure Pipelines use the TFS Cross Platform Command Line utility.

Tasks can also be deployed with an Azure DevOps extension. See this tutorial for how to write a custom task and package it inside an extension.

Contributing

This project welcomes contributions and suggestions.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Issues

We accept issue reports both here (file a GitHub issue) and in Developer Community.

Do you think there might be a security issue? Have you been phished or identified a security vulnerability? Please don't report it here - let us know by sending an email to secure@microsoft.com.