Accelerate Azure DevOps or TFS with JFrog Artifactory and NuGet

Azure DevOps or TFS with JFrog Artifactory

Azure DevOps is the evolution of VSTS (Microsoft Visual Studio Team Services), which is also known as VSTS, support continuous integration/continuous deployment (CI/CD).

Alongside support for Maven, NPM, Docker, and Generic builds, the JFrog Artifactory Extension for Azure DevOps and Team Foundation Server TFS has just been improved to support the NuGet package type. This addition extends the extension’s capabilities to trigger builds with NuGet packages and upload the Build Info to Artifactory. This integration allows your build jobs to deploy artifacts to and resolve dependencies from Artifactory, and then have them associated to the build job that created them.

Why JFrog Artifactory?

As the universal binary repository manager, JFrog Artifactory provides one reliable solution for all your binaries, with consistent support for all major package formats, build tools, and CI servers. Artifactory’s integration with Azure DevOps and TFS enables you to manage your Microsoft-based pipeline, and gain full traceability of your builds by capturing Build-Info from your builds.

Let’s create a build pipeline in Azure DevOps using Artifactory in 3 easy steps.

STEP 1: Configure the Artifactory Instance

Once the Artifactory Extension is installed, you must configure Azure DevOps to access the Artifactory instance:

  1. In Azure DevOps, go to Project Settings > Pipelines > Service connections.
  2. Click + New service connection to display the list control, and select Artifactory.
  3. In the service connection dialog, enter the required URL and credential information, click on the verify connection, and save the new configuration.

STEP 2: Create a NuGet Pipeline

Once your Artifactory connection is configured, you can add a NuGet Build pipeline:

  1. Pull this NuGet example and configure the Git sources task.
    Configure Git sources task
  2. In the Add tasks section, search for NuGet in the task selection list.
  3. Select the Artifactory NuGet task and add it to the pipeline.
    Add Artifactory NuGet task
  4. In the new task, select which NuGet command to run. In the example below, we’ll use the restore, pack and push commands.
    Select NuGet command

STEP 3: Configure the Push task buildinfo to Artifactory

When the pipeline containing the NuGet task executes, the task log will show all information about the executed NuGet command:

Task log

You can configure your NuGet task to collect the buildinfo by selecting the Collect build info checkbox when you add a task:

configure NuGet task to collect buildinfo 1

configure NuGet task to collect buildinfo 2

Once collected, the buildinfo can then be pushed as metadata to Artifactory, it can be accessed from the Artifactory tab in the Build Results:

accessing buildinfo metadata from Artifactory

After you run the pipeline, you’ll be able to see the build information for the NuGet task in Artifactory:

build information for NuGet task in Artifactory

The JFrog Artifactory Extension for Azure DevOps and TFS is available in the Visual Studio marketplace. Try it out for yourself.