Create a multi-platform pipeline

Azure DevOps Services | Azure DevOps Server 2022 | Azure DevOps Server 2020

This is a step-by-step guide to using Azure Pipelines to build on macOS, Linux, and Windows.


Make sure you have the following items:

  • A GitHub account where you can create a repository. Create one for free.

  • An Azure DevOps organization. Create one for free. If your team already has one, then make sure you're an administrator of the Azure DevOps project that you want to use.

  • An ability to run pipelines on Microsoft-hosted agents. You can either purchase a parallel job or you can request a free tier.

Get the sample code

You can use Azure Pipelines to build an app on written in any language, on multiple platforms at the same time.

  1. Go to

  2. Fork the repo into your own GitHub account.

You should now have a sample app in your GitHub account.

Add a pipeline

In the sample repo, there's no pipeline yet. You're going to add jobs that run on three platforms.

  1. Go to your fork of the sample code on GitHub.

  2. Choose 'Create new file'. Name the file azure-pipelines.yml, and give it the contents below.

# Build NodeJS Express app using Azure Pipelines
      imageName: 'ubuntu-latest'
      imageName: 'macOS-latest'
      imageName: 'windows-latest'

  vmImage: $(imageName)

- task: NodeTool@0
    versionSpec: '8.x'

- script: |
    npm install
    npm test

- task: PublishTestResults@2
    testResultsFiles: '**/TEST-RESULTS.xml'
    testRunTitle: 'Test results for JavaScript'

- task: PublishCodeCoverageResults@1
    codeCoverageTool: Cobertura
    summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/*coverage.xml'
    reportDirectory: '$(System.DefaultWorkingDirectory)/**/coverage'

- task: ArchiveFiles@2
    rootFolderOrFile: '$(System.DefaultWorkingDirectory)'
    includeRootFolder: false

- task: PublishBuildArtifacts@1

At the bottom of the GitHub editor, select Commit changes.

Each job in this example runs on a different VM image. By default, the jobs run at the same time in parallel.

Note: script runs in each platform's native script interpreter: Bash on macOS and Linux, CMD on Windows. See multi-platform scripts to learn more.

Create the pipeline

Now that you've configured your GitHub repo with a pipeline, you're ready to build it.

  1. Sign in to your Azure DevOps organization and navigate to your project.

  2. In your project, go to the Pipelines page, and then select New pipeline.

  3. Select GitHub as the location of your source code.

    Select GitHub

  4. For Repository, select Authorize and then Authorize with OAuth.

  5. You might be redirected to GitHub to sign in. If this happens, then enter your GitHub credentials. After you're redirected back to Azure Pipelines, select the sample app repository.

  6. For the Template, Azure Pipelines analyzes the code in your repository. If your repository already contains an azure-pipelines.yml file (as in this case), then this step is skipped. Otherwise, Azure Pipelines recommends a starter template based on the code in your repository.

  7. Azure Pipelines shows you the YAML file that it will use to create your pipeline.

  8. Select Save and run, and then select the option to Commit directly to the main branch.

  9. The YAML file is pushed to your GitHub repository, and a new build is automatically started. Wait for the build to finish.


Can I build my multi-platform pipeline on both self-hosted and Microsoft-hosted agents?

You can, you would need to specify both a vmImage and a Pool variable, like the following example. For the hosted agent, specify Azure Pipelines as the pool name, and for self-hosted agents, leave the vmImage blank. The blank vmImage for the self-hosted agent may result in some unusual entries in the logs but they won't affect the pipeline.

      poolName: Azure Pipelines
      vmImage: ubuntu-latest

      poolName: FabrikamPool

  name: $(poolName)
  vmImage: $(vmImage)

- checkout: none
- script: echo test

Next steps

You've just learned the basics of using multiple platforms with Azure Pipelines. From here, you can learn more about:

For details about building GitHub repositories, see Build GitHub repositories.