Publish Azure DevOps Extension with Azure DevOps Pipeline

Nevin Cansel Efendioglu
KoçSistem
Published in
4 min readJul 27, 2021

Azure DevOps Extensions can be packaged and published by using Azure Pipelines. There is a free extension that provides build and release tasks for packaging and publishing Azure DevOps Extensions available in Visual Studio Marketplace.

Azure DevOps Extension Tasks are made by “Microsoft DevLabs” for constructing Azure DevOps extensions.

First, we need to create a personal access token to publish our extension to Visual Studio Marketplace.

Personal access token must be created in Azure DevOps cloud even though you have an Azure DevOps Server. Otherwise, publish extension step will fail.

I assume that you already pushed your code to your repository but do not forget to configure your trigger so that when you push a change, new version of your extension will be automatically published.

Let’s start to construct our pipeline.

We will have four steps to publish our extension.

1. Use Node CLI for Azure DevOps (tfx-cli)

This step installs the Node CLI for Azure DevOps (tfx-cli) on your agent. We need this step to package and publish our extension.

2. Query Extension Version

This step will query the current version from the Visual Studio Market Place. We need this step to increase our version number for each build.

To connect to Visual Studio Marketplace, we will create a connection by clicking new.

We will enter our PAT we created before and name our connection.

Then, we will enter other information which is needed.

  • You can choose Major, Minor or Patch for Increase version field. We prefer to increase our version as patch. If our current version 1.0.1, it will be 1.0.2.
  • Reference name under Output Variables is important! If you don’t give a reference name, variable will not be used. We used adx as AzureDevOpsExtension. You can use whatever you want.

We increased our version to 1.0.2 above and assign it to our variable adx.Extension.Version to use it while packaging. Why do we need this? Look at the Package Extension step.

3. Package Extension

This step package an Azure DevOps extension into a VSIX file by using our manifest file vss-extension.json.

We use our variable which we created in the second step to declare our new version number. Otherwise package will be created with the version number in vss-extension.json and there will be a conflict with the current version in the marketplace so that our pipeline will fail.

4. Publish Extension

We will use the same connection we created in the second step to connect Visual Studio Marketplace.

If your extension is private and you want to share it with other organizations, you can write organization names in the Share with field. This field will be ignored if you choose public.

Now, our pipeline is ready to publish!

Go, make a change and commit! See how fast your extension will be published in the marketplace.

Hope you enjoy the article.

--

--