How to Configure NuGet Repositories [video]

How to Configure NuGet Repositories [video]

AuthorFullName__c
Snir Ben Ami
articleNumber
000005085
ft:sourceType
Salesforce
FirstPublishedDate
2021-05-25T12:51:22Z
lastModifiedDate
2023-01-22T11:05:55Z
VersionNumber
4

In this short video we will learn how to configure the NuGet client and NuGet repositories



 

Video Transcript:
Hi, my name is Snir from JFrog Support. In this short video, we are going to learn how to create NuGet repositories in Artifactory, and how to configure the NuGet client against them. Before configuring the NuGet repositories and the client, I would like to talk about a special repository setting in Artifactory, called Force Authentication.

When multi-factor is configured to allow anonymous access, by default it will not request the NuGet client for its authentication parameters. This can work well if the anonymous user has the right permissions to the NuGet repositories. But, if it doesn’t, every operation from the NuGet client against the repository and Artifactory will fail. In order to override this behavior, we need to enable the Force Authentication setting, which will require authentication of the NuGet client. This setting can be applied to any type of repository, local, remote, or virtual.

In order to create NuGet repositories, we can use the quick setup button, choose NuGet, and assign a prefix. I’ll simply use Global. As you can see, three repositories will be created, a local repository where we will deploy our NuGet packages, a remote repository, which is proxy to a NuGet remote ripple. By default, it’s configured to proxy NuGet Gallery. The third repository is a virtual ripple, which aggregates the local and the remote repositories under a single endpoint. We will configure our client to work against this ripple. Create.

Now, let’s go ahead and enable the Force Authentication setting on the virtual repository. Navigate to the virtual tab, and choose the repository. Scroll down, enable the Force Authentication check box, and save of course.

Now let’s configure the NuGet client. In order to do this, the set me up button is our best friend. Let’s navigate to the three browser. Choose the virtual ripple, set me up, and type the password. As you can see we have three tabs, configure, deploy and result.

The configuration tab includes instruction to configure the NuGet client, the V3 API, and the visual studio configuration. Let’s copy the NuGet client configuration command and paste it in the terminal. That’s it. Now our client is configured against the NuGet virtual repository in Artifactory. The client configuration file is called nuget.config. It can be found in the user home directory under .config and NuGet.

Let’s open the file to see its content. As you can see, the file contains the Artifactory repository URL and all credentials. Let’s use the NuGet package by Artifactory. For this demo, I will use the Jake Wood package. Great. We resolve the Jake Wood package, and we can see it was resolved to Artifactory.

This was my video about NuGet Repository Configuration. Thank you for watching, and I hope you find it useful. Feel free to leave your comments, feedback or questions in the comment section below.