Artifactory Local NuGet repository

Artifactory provides support for a number of NuGet repositories including Local, Remote and Virtual repositories. An Artifactory Local NuGet repository can be configured in Octopus as an external NuGet feed.

Configuring an Artifactory Local NuGet repository

This guide was written using Artifactory version 7.11.5.

From the Artifactory web portal, navigate to Administration ➜ Repositories. From there, choose Add Repositories ➜ Local Repository:

Artifactory repositories addition

From the Package Type selection screen, choose NuGet:

Artifactory local repository

Give the repository a name in the Repository Key field, and fill out any other settings for the repository.

Artifactory local repository settings

When you’ve entered all of the settings, click Save & Finish.

Configure repository authentication

With the repository configured, the next step is to configure access so Octopus can retrieve package information.

The recommended way is to either configure a user with sufficient permissions, or use an access token. This user is the account which Octopus will use to authenticate with Artifactory.

Every organization is different and the authentication example provided here is only intended to demonstrate functionality. Ensure you are complying with your company’s security policies when you configure any user accounts and that your specific implementation matches your needs.

From the Artifactory web portal, navigate to Administration ➜ Identity and Access ➜ Users and select New User.

Artifactory Add user

Fill out the User Name, Email Address, Password and any other settings.

If you have an existing group to add the user to, you can do that here. Alternatively you can add the user account when creating a new group.

When you’ve entered all of the settings, click Save.

Next, we need to ensure the user is in a group which can access our new repository.

From the Artifactory web portal, navigate to Administration ➜ Identity and Access ➜ Groups and select New Group.

Artifactory Add Group

Fill out the Group Name and any other settings. Ensure the user you created earlier is included in the group (in the right hand column).

When you’ve entered all of the settings, click Save.

Lastly, we need to ensure the group has permissions for Octopus to retrieve package information.

From the Artifactory web portal, navigate to Administration ➜ Identity and Access ➜ Permissions and select New Permission.

From there, give the permission a Name, and choose the Add Repositories option:

Artifactory add permission

From the repository selection screen, choose the newly created repository so that it’s in the Included Repository column and click OK:

Artifactory add permission repository

Next, switch to the Groups tab, and add a new group from Selected Groups:

Artifactory add permission group

From the groups selection screen, choose the newly created group, or an existing group so that it’s in the Included Group column and click OK.

Artifactory permissions include group

Finally, choose the permissions to grant the group on the included repositories:

Artifactory repository permissions

Octopus needs Read permissions as a minimum on the Local repository in order to search and download packages.

When you’ve entered all of the settings, review your permissions are configured how you want, and click Create.

You can also choose individual users to assign this permission to.

Anonymous authentication

An alternative to configuring a user is to enable anonymous access on the NuGet repository.

Adding an Artifactory Local NuGet repository as an Octopus External Feed

Create a new Octopus Feed by navigating to Library ➜ External Feeds and select the NuGet Feed Feed type.

Give the feed a name and in the URL field, enter the HTTP/HTTPS URL of the feed for your Artifactory Local repository in the format:

https://your.artifactory.url:port/artifactory/api/nuget/v3/local-nuget-repo

Replace the URL and port from the example above. In addition, replace local-nuget-repo with the name of your Local NuGet repository.

Artifactory Local NuGet feed

Save and test your feed to ensure that the connection is authenticated successfully.

Help us continuously improve

Please let us know if you have any feedback about this page.

Send feedback

Page updated on Sunday, January 1, 2023