Libman in Azure DevOps Pipelines
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/build/variables?view=azure-devops&tabs=yaml
Related Articles
Docker ASP.NET Core SSL Certificate Configuration (Linux & Windows Containers)
How to configure HTTPS and mount PFX SSL certificates in Dockerized ASP.NET Core applications on Linux and Windows Server containers.
Add Azure Function App Identity to MSSQL
How to add Azure Function App Identity to MSSQL
Adding App Identity to Directory Readers Role in Azure
How to assign a user-assigned Managed Identity to the Directory Readers role in Microsoft Entra ID (Azure AD) to resolve SQL error Msg 37353.