Azure Pipelines

Native plugin directly available in the Marketplace

Setup

You can get the plugin directly from the Visual Studio Marketplace.

Prerequisites

manifest.yml file

Place the manifest.yml file containing the correct information about your project in your project repository. You can use any path you want, this is passed to the LeanIX pipeline task as an input parameter.

miCiCd-init.gradle

In case you are using gradle as dependency manager on your project, you need to put this file in the root of your repository. It will be provided to you by LeanIX.

Secret LeanIX API token

In the “Edit”-section of your pipeline in which the LeanIX task is used, a secret must be created, the value of which is a valid LeanIX token for the host that is used in the task.

For the use of secrets in Azure DevOps pipelines see also Define variables - Azure Pipelines

Adding the task to your Azure DevOps pipeline

If you want to add the LeanIX task to a Azure DevOps pipeline, you can either use the example pipeline code listed below or use the search field for tasks in the edit mode of your Azure DevOps pipeline. For more information on how to use tasks, see also Key concepts for new Azure Pipelines users and the related pages.

In the search field search for “LeanIX” and click on the upcoming result task. In the appearing input dialog for the task specify the input parameters according to the description of the parameters below on this page. Of course you can also use environment variables as input parameters here ( Define variables - Azure Pipelines ).

Monitoring of pipeline runs


The monitoring of the pipeline including the LeanIx task can be done in the runs overview belonging to the pipeline or for continuous monitoring you can see also Add continuous monitoring to your release pipeline- Azure Monitor .

Simple example pipeline with the LeanIX DevOps task

The input parameters used in the example are explained in more detail in the "Inputs" section.

In the example the token to access the LeanIX API (see also section “Secret LeanIX API token) is hidden in the secret variable $(apitoken).

trigger:
- main

pool:
  vmImage: ubuntu-latest
  
steps:

- task: [email protected]
  inputs:
    apitoken: '$(apitoken)'
    host: 'app.leanix.net'
    manifestpath: '/lx-manifest.yml'
    stage: 'test'
    version: '1.2.4'
    dependencymanager: 'NPM'
    allowfailure: true

Mandatory and optional definitions

The steps and assignments carried out in the example are necessary for the use of the LeanIX task. In addition to the input parameters of the task under “inputs:” to be set correctly, you can choose the following values ​​yourself:

  • “-task: [email protected]": By changing the version of the task after “@” you can choose which version of the LeanIX task you want to use, if more than one is available in the Visual Studio Marketplace.

Inputs

api-token

Required

The LeanIX API token for secure access to the LeanIX API on the chosen host. Use the variable you specified in the pipeline variables for it here.

host

Required

The LeanIX host where the integration is located that you want the task to connect to, e.g.: eu.leanix.net

manifest-path

Required

The path to the LeanIX manifest in your repository. Default: /lx-manifest.yml

dependency-manager

Required

Type of the dependency manager used for the project. Supported possible values: NPM, MAVEN, GRADLE, NUGET.

stage

The stage the pipeline is triggered for. Default: production

version

Required

The current version the pipeline is triggered for.

allow-failure

Flag that indicates whether the entire pipeline is allowed to continue if an error occurs in the LeanIX task. "True" means, the pipeline continues upon error in the task, "false" makes it exit with error. Default: true


Did this page help you?