A repository to show how to use a private NuGet feed in both Azure DevOps and GitHub Actions.
Project | Azure Pipelines | GitHub Actions |
---|---|---|
ASP.NET Blazor (.NET 5) | Classic pipeline | |
WPF (.NET Framework) | Classic pipeline | |
Console (.NET 5) | YAML pipeline |
The following 4 minute video takes you though all the steps on adding a private NuGet feed as a Service Connection and consuming that service in three different pipeline setups.
- Adding a Service connection at 0:09
- Classic pipeline for .NET Core at 1:14
- Classic .NET Framework pipeline at 1:47
- YAML pipeline setup for .NET Core at 2:25
A common problem to run into is to think that the environment variable is the same thing as the GitHub Secret (or Azure DevOps pipeline variable). In this demo, I intentionally named the secrets a different name than the environment variable name so that it is easier for you to tell the difference.
However, I know that not everyone has the tiime to watch the video and just copy/paste the YAML. This will cause you to hit a roadblock because you missed the part about setting up the GitHub secret (or Azure DevOps pipeline variable). Here are a couple screenshots you can solve the issue and bounce :)
In your YAML, you probably have done this:
That mean you must also have the secrets in your Settings > Secrets list