Introduction
This collection only fork and migrate to newer Node.js v20 (because of Node 16 deprecation) without any modifications of the following task packs:
1. Variables Tasks Pack

Build & Release tasks to manipulate variables. This extensions is comprised of eight tasks
Configuration
After you install the extension in your account (see Get extensions for Visual Studio Team Services to learn how to install extensions) you are ready to use the task on your build or release defintions on the account(s) you have installed the extension into.
It may take a while until the tasks are available to be used.
Tasks
When you add a new step to your build or release template, you can chose the task from the Utility category, each task has a different set of purposes and parameters.
Set Variable
This task allows to set/change the value of a variable, it has three parameters (transformations may have additional parameters:
- Variable Name The name of the variable to set
- Variable new value The value to set
- Transformation Applies a transformation to the value
- upper case the result will be all upper cased
- lower case the result will be all lower cased
- replace replace a string with another (a regular expression may be used, use regular expression replace for more advanced replacement scenarios)
- sub set transformation gets a subset of the value
- regular expression match match a part of the new value using a regular expression
- regular expression replace replaces the new value string using a regular expression replacement
The sub set transformation allows you to get a part of a string. It has two extra parameters:
- Index start The index of the string sub set (zero based index)
- Index end The index end of the string sub set. No value means the rest of the string after Index start
Allows you to get a part of of the string using a regular expression. It has four extra parameters:
- Regular expression The regular expresion to match. (You can use capturing groups to match a subset of the regular expression)
- Match group number 0 (zero) to get the entire regular expression match or a value different than zero to match a capturing group. (1 based index. 1 for first group,2 for second,etc)
- Case Insensitive Case insensitive matching
- Fail if no match If no match is found the task should fail (thus failing the build/release unless you have enabled Continue on error option)
The task with the following parameters

will set the value 1 into the myVar variable
The regular expression replace transformation is much more powerful than the replace transformation, allows you to better control how the replacement is made.
It has the following extra parameters:
- Regular expression The regular expresions used for the replacement
- replacement value Replacement value, you can use the following special replacement patterns:
- $$ Inserts a $
- $& Matched substring
- $` the portion of the string that precedes the matched string
- $n where n is a number that represents the matching sub group (starts at 1)
- Case Insensitive Case insensitive matching
- Replace all should all matches be replaced or just the first
The task with the following parameters

will set the value 3 matches three two one Entire Match = one two three 3 strings into the myVarReplacedValue variable
Set Variables with Credential
This task sets the username/password stored on a generic connection. This task can be used to centrally store a username/password and pass them to tasks that require a username/password without having to have the credentials replicated all over build/release definitions, with this task you can have single copy which can be centrally managed and change it centrally.
This task has three parameters:
- Connection The connection
- Username variable name
- Password variable name
In your can register service endpoints to store your reusable username/password to use in other tasks.
You need to create a Credential endpoint to store the user name and password.

The credental endpoint has the following parameters
- Connection Name The name of the connection, this is just a name for your reference. This name will be visible in the connection dropdown selection in the task
- username (optional) for this credential
- Password for this credential, you can use it with other secrets like tokens or such.
- Expiration Date (optional) You can see an expiration date on the credential. If you set a credential the build will fail if you try to use an expired credential. Ten days before expiration the task will issue warnings about expiration.
- Comment (optional)
Note You need to be member of "Endpoint Creators" group to create service endpoints.
Sets variable with value from JSON
Extracts a value from JSON (either a file or a variable) using a JSON path expression and sets the value to a variable.
If the result is a primitive type (boolean, number,string) that value will be set. If it's an array all values will be set (comma separated), all other types will be set as a JSON string.
The task has the following parameters
- Variable Name The name of the variable to set
- JSONPath expression The expression will be used to extract the value from the JSON (more info on JSONPath)
- JSON content The JSON content (if you don't specify a JSON content, you will need to specify a JSON file) where the value will be extracted from.
- JSON file The file with JSON content and where the value will be extracted from.
Sets variable with value from XML
Extracts a value from XML (either a file or a variable) using a XPath expression and sets the value to a variable.
Only node text or attributes are supported.
The task has the following parameters
- Variable Name The name of the variable to set
- XPath expression The expression will be used to extract the value from the XML
- XML content The XML content (if you don't specify a XML content, you will need to specify a XML file) where the value will be extracted from.
- XML file The file with XML content and where the value will be extracted from.
Update Build Number
Sets the build number with the passed value. Allows to you set the build number with a different number than the one it was initially assigned on queue.
Useful when you want to set the build number using a number with values which build number formatting settings don't support out of the box.
The task has a single parameter
- New Build Number The value of the new build number
Update Release Name
Sets the release name with the passed value. Allows to you set the releaze name with a different name than the one it was initially assigned on queue.
The task has a single parameter
- New Release Name The value of the new release name
Increment Version
Increments a build version in the semver format.
Allows you to increment by one number the following version components; major, minor or patch.
It can also clear the release or the build.
The task has the following parameters
- Version The version number to increment
- Increment Component Which version component to increment
- Major
- Minor
- Patch
- Clear Release If the version has a release component then clear it (eg: 1.1.0-alpha becomes 1.1.1 (assuming it was incrementing the patch))
- Clear Build If the version has a build component then clear it (eg: 1.1.0+20160101 becomes 1.1.1 (assuming it was incrementing the patch))
Adds one or more tags to a b uild
The task has a parameter
- Tag(s) The tag(s) you want to add to the build. One tag per line.
2. Rest Call

This extension provides a build task to call a web service.
This extension installs the following components:
- A build task to call a web service over HTTP management endpoint.
Create a generic Connection to your web service
- Make sure your webservice interface is exposed and can be reached over the network.
- Open the Services page in your Visual Studio Team Services Control Panel
- In the New Service Endpoint list, choose "Generic"
- Specify your webservice URL, and optionnaly username and password (if you want to use a PAT instead of username/password, set the PAT as password).
Add the Rest Call task to your build or release
Edit the build or release you want to update
Select the build task "Rest Call" available in the "Utility" category.
Set the parameters :
WebService endpoint: set the endpoint you previously defined.
Relative url to call on endpoint: set the url end part of the url.
e.g. if your endpoint target a webservice at "http://domain/", you may have to define the relative url to "api/targetedRessource/action".
Http method: Get, Post, Put or Delete. Depending on this choice, the following "body" field will be available or not.
Body (if Http method set to Post or Put): allows you to set a body if needed (json or whatever you want).
Content-type: defines the corresponding http-headers. It has only been tested with "application/json"...
save response to file: allows you to save the http response to a file. If checked, the following "output path" parameter will be available.
Output file path: defines the path of the file you want to save the http request to.
3. GitLab Integration for Azure Pipelines

This extension integrates GitLab with Azure Pipelines. With this extension, you will be able to download the sources from a GitLab repository (using clone command) and use downloaded sources in Azure Pipelines. The extension comes as an artifact source in Release Management and also has a Build task to download sources in your build pipeline.
3rd Party Notices
- GitLab is the trademark of GitLab, Inc. The GitLab trademark and logo are associated with GitLab - For details go to GitLab License page.
- This extension has been developed by Utkarsh Shigihalli and is not associated with GitLab.
Usage
1. Connecting to GitLab
The extension provides a GitLab service connection to connect to GitLab using a Personal access token (PAT).
To connect, go to Project Settings | Service connections tab and create a New service connection and click on GitLab

You will now see a window asking for GitLab details. Enter your GitLab UserName and API Token. Give service connection a name and Verify connection.

If you verified successfully, click OK to save.
2. Downloading GitLab repo in Release
Once you have the GitLab service connection setup, go to Release hub in Azure Pipelines and edit a release definition. Click Add [1 in image below] on artifacts and select GitLab [2 in image below].

You will then need to select the GitLab service connection you created. Once you select, the extension will list all the repositories you own, and after that you will have three options to select artifact version.
Latest from default branch: This will download the default branch for the repository.
Latest from specific branch: This will list all the available branches and download the latest commit from the selected branch.
Specify at the time of release creation: As the name suggests, you will have the option to specify the commit id while triggering a release.

Save the release definition and trigger a new release.
In the dialog which opens, you will see all your linked artifacts. You will have an option to fill in the commit id if you have selected specify at the time of release creation for an artifact source.

3. Browse artifacts
Once you link your artifact to release, you will also be able to browse the linked artifacts from GitLab in any of the tasks in your pipeline. In the image below, I am browsing artifacts from GitLab inside a Copy Files task. Cool right?

4. Downloading GitLab repo in Build
In some scenarios, you may also want to consume the GitLab repository in your Azure Pipelines build definition. The extension provides the build task to clone and download the repository.
In your build definition, search for the task and you should see the task listed.

Click Add and select the created GitLab service connection. Once you do that, as you can see from the screenshot, you will be able to select the repository, branch and version. You will have to specify the Download Path to which the source from GitLab should be downloaded. In the image below, I am setting it to a Azure DevOps variable $(build.sourcedirectory) but you can use any valid path.

Changes
- v#{Release.ReleaseName}#
- v1.0.7
- Fix issue 2 where only user owned repos were fetched rather than membership
- v1.0.5
- Fix issue 8 where on-premises URL configured in the endpoint was not considered
- Merge pull request #6
- Other minor fixes
- v1.0.0
For more details please see GitHub releases
Feedback
Please rate the extension and share/tweet to spread the word!!
- Found a bug or need to make a feature request? - Raise it as an issue.
- Have a question? - Raise it here in the Q and A section.
Credits
Special thanks to Sriram Balasubramaniam, Omesh Pandita, Romil Goyal, Ashok Kirla and Gopinath Chigakkagari from Microsoft product team, for all the guidance and support in developing this extension.
Telemetry
The tasks send anonymous telemetry so we can get a hold of task usage and errors.
No user data or task parameters are ever collected under any circunstances. Only data that allows anonymous usage collection.
The data is deleted after 7 days.