ARTIFACTORY: How to proxy nuget.optimizely.com using Artifactory
To simplify the process of installing packages from a remote NuGet repository that points to Optimizely packages via the V3 protocol, it is essential to follow the recommended steps outlined below. Please note that the V2 protocol will soon be deprecated, so it is advisable to transition to the V3 protocol.
How to configure the remote NuGet repository.
1. Configure the Remote NuGet Repository:
a. Create a remote NuGet repository and set its location to: https://nuget.optimizely.com
b. Update the NuGet Download Context Path to: feed/packages.svc/package
c. Update the NuGet Feed Context Path to: feed/packages.svc
d. Update the Feed URL to: https://api.nuget.optimizely.com/v3/index.json
b. Update the NuGet Download Context Path to: feed/packages.svc/package
c. Update the NuGet Feed Context Path to: feed/packages.svc
d. Update the Feed URL to: https://api.nuget.optimizely.com/v3/index.json
2. Connect Your Client using V3 Protocol:
a. Follow the "set-me-up" instructions to connect your client using the V3 protocol.
b. Execute the following command as an example:
“nuget sources Add -Name Artifactory -Source https://<ARTIFACTORY_URL>/artifactory/api/nuget/v3/<REPOSITORY_NAME>/index.json -username <USER_NAME> -password <PASSWORD>”
b. Execute the following command as an example:
“nuget sources Add -Name Artifactory -Source https://<ARTIFACTORY_URL>/artifactory/api/nuget/v3/<REPOSITORY_NAME>/index.json -username <USER_NAME> -password <PASSWORD>”
This is an example of my Nuget Configuration file Nuget.Config:
<?xml version="1.0" encoding="utf-8"?> <configuration> <packageSources> <add key="Artifactory" value="https://<ARTIFACTORY_URL>/artifactory/api/nuget/v3/<REPOSITORY_NAME>/index.json" /> <add key="ArtifactoryOptimizely" value="https://<ARTIFACTORY_URL>/artifactory/api/nuget/v3/<REPOSITORY_NAME>/index.json" /> </packageSources> <packageSourceCredentials> <Artifactory> <add key="Username" value="<USER_NAME>" /> <add key="Password" value="<PASSWORD>" /> </Artifactory> <Artifactoryopt> <add key="Username" value="<USER_NAME>" /> <add key="Password" value="<PASSWORD>" /> </Artifactoryopt> </packageSourceCredentials> <activePackageSource> <add key="Artifactory" value="true" /> <add key="ArtifactoryOptimizely" value="true" /> </activePackageSource> <disabledPackageSources> </disabledPackageSources> </configuration>
Important note: Avoid configuring a virtual repository that combines both Optimizely and nuget.org, as indexing is not supported in this use-case.