Skip to content

Instantly share code, notes, and snippets.

Last active December 15, 2020 00:10
What would you like to do?

Create Private NuGet feed for use with Azure Devops


It is possible to host and publish to a private NuGet feed within Azure DevOps


  • Under Artifacts click Create Feed
    • Name the feed as desired
    • select user visilibity (probably "Azure AD" or at least members of Project
    • upstream is optional.
    • set scope (probably for your project)
  • Within your project create a nuget.config file as below
    • set NameOfYourFeed as desired
    • set PathToYourFeed as shown under the connect to feed in the artifact from above
        <add key="NameOfYourFeed" value="PathToYourFeed" />
        <add key="" value="" protocolVersion="3" />
  • Add steps to build pipeline
    • Authentication Pipeline to NuGet
    • Add dotnet nuget push
    • Ensure dotnet pack includes versioning

Pipeline NuGet Authentication

    - task: NuGetAuthenticate@0
      displayName: 'NuGet Authenticate'

Pipeline Nuget Push

    - task: DotNetCoreCLI@2
      displayName: Push Packages to Private NuGet
        command: 'push'
        packagesToPush: '$(build.artifactStagingDirectory)/**/*.nupkg'
        nuGetFeedType: 'internal'
        publishVstsFeed: 'FEED-ID'

Pipeline Dotnet Pack Versioning

    - task: DotNetCoreCLI@2
      displayName: Package to Staging directory
        command: custom
        custom: 'pack'
        arguments: 'yoursolution.slnproj -c=$(BUILD_CONFIGURATION) -o $(Build.ArtifactStagingDirectory) /p:Version=$(fullSemVer)'
        verbosityRestore: Minimal
        verbosityPack: Minimal
        feedsToUse: select
        vstsFeed: personalnugetfeed
        nuGetFeedType: internal
        includeNuGetOrg: true


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment