Terug naar overzicht

Azure NuGet Feed

Door Bruno Latte

.NET

May 2021

In a previous post we saw how to use NuGet Package Explorer to create a NuGet package. There are several different ways to distribute your packages between your development teams. You could use a USB drive or send it by email (just kidding). The easiest way would probably be to use a file share on some server in your on-premise network. These days however everything is moving to the cloud. So, let’s see how we can create our own NuGet feed with Azure DevOps.

This assumes you have an Azure account, you can get one for free at /. Select the project in your organization where you want to host the NuGet feed.  

Azure Artifacts are used to host package feeds. In the Artifacts tab, create a new feed. Choose a name, set visibility and if you want to include public sources. 

Connect to the feed and select “NuGet.exe” in the next screen. This will show you steps required for when you build NuGet packages directly from your solution. We’ll be pushing package from our drive with the NuGet.exe tool. You can get it through the “Get the tools” button or from /downloads. Save the nuget.exe in the directory of your packages on your drive or make it available through your Windows PATH variables.  

Note: When ‘Upstream sources’ is checked, any packages downloaded from these sources will be copied to your personal feed. The reasoning behind this is, if for some reason the upstream source is down, your development teams can still download the packages from your personal feed.
However these copied packages do count for your storage billing. Free tiers get 2GB of storage, which is probably more then you’ll need, but it’s important to keep an eye on. 

Copy the feed url from the “Project setup” and the command line string from the “Publish packages” to a notepad. In the publish string replace the Source by the url and <packagePath> by the location of your NuGet package.  

nuget.exe push -Source
/BlogDemos/NuGetDemo/_packaging/DemoFeed/nuget/v3/index.json” -ApiKey az “eu.allphi.company.style.1.0.0.nupkg”

Run it from a command prompt, you’ll be asked to login (once) and your package will be pushed. 

Now you can add this NuGet feed in Visual Studio as a package source in the NuGet package manager using the same url. 

It’s that simple. You can host any NuGet package in your own personal feed. 

Strong Under Pressure: resilient HTTP clients Thumb

Door Michiel Mijnhardt

Nov 2024

Strong Under Pressure: resilient HTTP clients

Building resilient applications is crucial, and part of that resiliency is making sure your applications outgoing http requests are covered. The .NET go to ...

An introduction to NSwag Thumb

Door Karel Verhulst

Aug 2024

An introduction to NSwag

In the world of modern web development, API's play a crucial role in enabling communication between different software systems. The process of creating, ...

Injecting into an AutoMapper TypeConverter using AutoFac in .NET Framework 4.8 Thumb

Door Ruben Verheyen

Jan 2024

Injecting into an AutoMapper TypeConverter using AutoFac in .NET Framework 4.8

Injecting dependencies into AutoMapper TypeConverters using Autofac in .NET Framework isn’t well-documented. After piecing together scattered resources, I ...

Cache primary btn default asset Cache primary btn hover asset Cache white btn default asset Cache white btn hover asset