# Libman in Azure DevOps Pipelines

> How to use Libman in Azure DevOps Pipelines

- Canonical URL: <https://carlossura.com/blog/libman-in-azure-pipelines/>
- Author: Carlos Sura
- Published: 2024-05-15
- Tags: windows, pipeline, libman, dotnet, restore

I was working with Azure DevOps, creating a pipeline for a dotnet application that requires Libman—a library that I'm not used to working with, so I had a few issues trying to install it and using the restore command; after searching in Google for a couple of hours and using the 'trial/error' method, I finally found a way to make it work.

The first step is to install the LibMan CLI globally

```
- task: DotNetCoreCLI@2
  displayName: 'Libman install'
  inputs:
    command: custom
    custom: tool
    arguments: 'install -g Microsoft.Web.LibraryManager.Cli'
```

With LibMan CLI installed, you use a simple script line to perform the libman restore, but in my case, I needed to specify the working directory since it was located in a subdirectory.

```
- task: CmdLine@2
  displayName: 'LibMan Restore'
  inputs:
    script: 'libman restore'
    workingDirectory: 'src/your-folder-where-libman.json-is-located'
```

You should find the references below to get more details about it.

That's it. Happy build!

**REFERENCES:**

https://learn.microsoft.com/en-us/azure/devops/pipelines/yaml-schema/steps-script?view=azure-pipelines

https://learn.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml
