When working with remote NuGet repositories, your Artifactory configuration depends on how the remote repositories are set up.
Different NuGet server implementations may provide package resources on different paths, therefore the feed and download resource locations in Artifactory are customizable when proxying a remote NuGet repository.
Note
If you are using NuGet V2, select a Remote registry from the following list of supported registries:
Remote Registry | Download Context Path | Feed Context Path |
---|---|---|
|
| |
|
| |
|
| |
|
| |
|
| |
N/A | N/A | |
N/A | N/A |
To create a Remote Repository, in the Administration module, go to Repositories | Repositories | Remote, and click New Remote Repository.
Here are some examples:
For the NuGet gallery configure the NuGet v3 Feed URL
http://host:port/api/v3/nuget/repoKey
while the URL can stay withhttp://host:port/artifactory/api/nuget/repoKey/
. Therefore, to define this as a new repository you should set the repository URL tohttps://www.nuget.org
, its Feed Context Path toapi/v2
and the Download Context Path toapi/v2/package
.Note
When accessing the remote
https://www.nuget.org/api/v3/Packages
, you are required to use API v3.
For NuGet v3 API and metadata configuration it is necessary to configure the NuGet V3 Feed
http://[host:port]/api/v3/nuget/repoKey
while the URL can stay withhttp://[host:port]/artifactory/api/nuget/repoKey/
.
Another Artifactory repository (i.e. a Smart Remote NuGet Repository) exposes its feed resource at
[http://host:port]/artifactory/api/nuget/repoKey/Packages
and its download resource athttp://[host:port]/artifactory/api/nuget/repoKey/Download
.To define this as a new repository you should set the repository URL to
http://[host:port]/artifactory/api/nuget/repoKey
, its Feed Context Path should be left empty and its Download Context Path to Download, like this:
Using a proxy server
If you are accessing NuGet Gallery through a proxy server you need to define the following two URLs in the proxy's allow list:
*.nuget.org
az320820.vo.msecnd.net
(NuGet Gallery's current CDN domain)