My organization is moving our software packages (NuGet, NPM) to Azure Artifacts. We have approximately 50,000 NuGet packages (2GB) that we've pushed to Azure Artifacts.
Is there a way to to bulk-pull my packages from Azure Artifacts either to my machine or to Azure blob storage in case we are not satisfied with the product? I'm mainly concerned about pulling our NuGet packages because we have thousands of packages published.
I'm aware of Download all packages from private nuget feed but I'd like to know if there's a way to retrieve a zip file of all of our packages, or some other method to download all of our packages in bulk.
Thanks!
We don't have a bulk download option, but it would be pretty easy to script something yourself.
First, you'll want to get a PAT. Make sure the PAT has the Packaging (read) scope. You will use the PAT as a password for authentication. The username you use doesn't matter.
Then, you'll need to get the list of all packages in the feed. You can use our Get Packages API for that.
Then, for NuGet packages, the protocol is as follows:
.../v3/index.json
)PackageBaseAddress/3.0.0
. This is the PackageBaseAddress. Note that the actual value is considered an implementation detail. Always retrieve the address from index.json.{PackageBaseAddress}/{PackageName (lowercased)}/index.json
which will have the list as a JSON array (I suggest getting the versions this way since they will already be normalized){PackageBaseAddress}/{PackageName (lowercase)}/{PackageVersion (normalized)}/{PackageName (lowercase)}.{PackageVersion (normalized)}.nupkg
{PackageBaseAddress}/restsharp/106.4.1/restsharp.106.4.1.nupkg
For npm packages:
.../npm/registry
){Feed URL}/{PackageName}
(for scoped packages include the scope, e.g. {Feed URL}/@{Scope}/{PackageName}
)