Node runner update guidance for Azure Pipelines task authors

Eric van Wijk

Introduction

This blog post contains important guidance for Azure Pipelines task authors. Task authors are developers that create custom pipeline tasks that are published on the Marketplace and/or used internally in their organization.

Background

Azure Pipeline tasks are executed using Task runners, which in turn are bundled with and invoked by the Pipelines agent.

Tasks use Node or PowerShell runners, which are distributed with the agent in the agent externals directory. The PowerShell runner uses Windows PowerShell. Therefore, to run cross-platform e.g. on macOS and Ubuntu, most tasks use a Node runner. For example, the AzureFunctionApp task uses the Node task runner and the VSBuild task uses the PowerShell runner.

Node Runner Lifecycle

Until recently, Azure Pipelines supported Node 6 and 10, and didn’t provide a mechanism for tasks to support more than one version at a time. Moving forward, our goal is to periodically add support for new LTS (long-term support) versions and periodically retire support for EOL (end-of-life) versions. This will require task authors, including us, to regularly update their tasks to support new versions of Node, optionally leaving support in place for older versions of Node to avoid breaking pipelines dependent on older agents and Node versions.

Node has yearly LTS (long term support) releases, that have even numbers. At some point these releases are End-of-Life (EOL) i.e., they do not receive new updates. This can be a concern for customers that see EOL Node versions listed in security scanner reports.
To catch up with LTS releases, we have recently added the Node 16 task runner and are updating our in-the-box tasks to use it. As we adopt LTS versions of Node, we will start removing EOL (End-of-Life) versions of Node runners.

Upcoming changes

For customers who do not want to run End-of-Life versions of Node, we provide the pipelines-agent-* release feed that excludes Node 6. By March 2023, this feed will exclude Node 10 as well as Node 6. Customers that install this (self-hosted) agent can only run tasks that use a non-EOL runner (Node 16 today). Any tasks not updated to use Node 16 will fail for agents deployed from this release feed.

Later in 2023, we will start removing End-of-Life Node runners from our Hosted agents as well. We will provide a method for customers to still use tasks dependent on the Node End-of-Life runners before we remove those runners from Hosted agents.

Call to action for Azure Pipelines task authors

To ensure tasks that use a Node runner remain working on the Azure Pipelines agent, task authors need to update Node dependent tasks to use the Node 16 runner.

As Microsoft Hosted agents and various Azure DevOps Server versions have different lifecycles, there can be different Node runner versions installed depending on where a task is running. To be able to run the same task on agents with different Node runner versions, task.json can contain multiple execution sections:

  "execution": {
    "Node10": {
      "target": "bash.js",
      "argumentFormat": ""
    },
    "Node16": {
      "target": "bash.js",
      "argumentFormat": ""
    }

In the above example, Azure Pipeline agents which include the Node 16 runner will choose it by default, and those which don’t will fall back to the Node 10 implementation.

Upgrade activities:

  • Test your task(s) on the various Node runner versions to ensure your code behaves as expected.
  • In your [task.json][7], under execution, update from `Node` or `Node10` to `Node16`.
  • To support older server versions, you should leave the `Node`/`Node10` target. Older Azure DevOps Server versions do not have the latest Node runner version included.
  • You can choose to share the entry point defined in the target or have targets optimized to the Node version used:
  "execution": {
    "Node10": {
      "target": "bash10.js",
      "argumentFormat": ""
    },
    "Node16": {
      "target": "bash16.js",
      "argumentFormat": ""
    }

Not adding support for the Node 16 runner will cause tasks to fail on agents installed from the pipelines-agent-* release feed.

Resources

Upgrading Tasks to Node 16
Node 16 task runner in pipeline agent
Updating Node in the Azure Pipelines agent

4 comments

Discussion is closed. Login to edit/delete existing comments.

  • Ana William 1

    Thanks for the Node runner update !

  • Tudor Stoian 4

    Any plans to update the PowerShell runner? It relies on Windows PowerShell 3, which is not event the latest Windows-specific version available. Why not update it to the cross-platform PowerShell 7, so that PowerShell task development wouldn’t feel like a second-class citizenship?

    • Roland Kieslinger 0

      Agree. PowerShell 7 support would be huge and is even necessary imho.

    • Eric van WijkMicrosoft employee 3

      That’s a very good suggestion that we are considering once we are up to date with Node runner versions

Feedback usabilla icon