A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://learn.microsoft.com/en-us/azure/devops/pipelines/packages/nuget-restore below:

Restore NuGet packages with Azure Pipelines - Azure Pipelines

Azure DevOps Services | Azure DevOps Server 2022 - Azure DevOps Server 2019

With NuGet Package Restore you can install all your project's dependency without needing to store them in source control. This allows for a cleaner development environment and a smaller repository size. You can restore your NuGet packages using the NuGet restore task, the NuGet CLI, or the .NET Core CLI. This article will guide you through restoring your NuGet packages using both Classic and YAML Pipelines.

Prerequisites Restore NuGet packages from a feed in the same organization
  1. Sign in to your Azure DevOps organization, and then navigate to your project.

  2. Select Pipelines, and then select your pipeline definition.

  3. Select Edit, and then add the following snippet to your YAML pipeline.

    steps:
    - task: NuGetAuthenticate@1
    
    - task: NuGetToolInstaller@1
      inputs:
        versionSpec: '*'
        checkLatest: true
    
    - script: nuget restore <SOLUTION_PATH>    ## If you're using Ubuntu 24.04 or later, use the following command instead: dotnet restore <SOLUTION_PATH>
    
  1. Sign in to your Azure DevOps organization, and then navigate to your project.

  2. Select Pipelines, select your pipeline definition, and then select Edit.

  3. Select + to add a new task. Add the NuGet tool installer, NuGet Authenticate, and Command line tasks to your pipeline. Leave the NuGet tool installer and NuGet Authenticate tasks with their default settings and configure the Command line task as follows:

  4. Select Save & queue when you're done.

Restore NuGet packages from a feed in another organization

To restore NuGet packages from a feed in a different Azure DevOps organization, you must first create a personal access token then use it to set up a NuGet service connection.

Create a personal access token
  1. Navigate to your Azure DevOps organization, and then select User settings > Personal Access Tokens.

  2. Create a new personal access token with Packaging* > Read scope. Copy your PAT as you'll need it in the following section.

  3. Select Create when you're done.

Create a service connection
  1. Sign in to the Azure DevOps organization where your pipeline will run, and then navigate to your project.

  2. Navigate to your Project settings > Service connections.

  3. Select New service connection, select NuGet, and then select Next.

  4. Select External Azure DevOps Server as the Authentication method, and then enter your target Feed URL. Paste the Personal Access Token you created earlier, provide a name for your service connection, and check Grant access permission to all pipelines if applicable to your scenario.

  5. Select Save when you're done.

Restore packages
  1. Sign in to your Azure DevOps organization, and then navigate to your project.

  2. Select Pipelines, and then select your pipeline definition.

  3. Select Edit, and then add the following snippet to your YAML pipeline.

    - task: NuGetToolInstaller@1
      inputs:
        versionSpec: '*'
        checkLatest: true
    
    - task: NuGetAuthenticate@1
      inputs:
        nuGetServiceConnections: <SERVICE_CONNECTION_NAME>
    
    - script: nuget.exe restore <SOLUTION_PATH>      ## If you're using Ubuntu 24.04 or later, use the following command instead: dotnet restore <SOLUTION_PATH>   
    
  1. Sign in to your Azure DevOps organization, and then navigate to your project.

  2. Select Pipelines, select your pipeline definition, and then select Edit.

  3. Select + to add a new task. Add the NuGet tool installer, NuGet Authenticate, and Command line tasks to your pipeline. Leave the NuGet tool installer with its default settings and configure the other tasks as follows:

    1. NuGet Authenticate task: Select your service connection from the Service connection credentials for feeds outside this organization dropdown menu.

    2. Command line task:

      • Display name: Restore.
      • Script: nuget.exe restore <SOLUTION_PATH>. If you're using Ubuntu 24.04 or later, use the following command instead: dotnet restore <SOLUTION_PATH>.
  4. Select Save & queue when you're done.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4