Warm tip: This article is reproduced from serverfault.com, please click

Nuget.exe push **\*.nupkg & Azure DevOps Artifacts

发布于 2020-11-29 06:18:03

I'm currently working on my organizations migration from on prem nuget (v2) to Azure DevOps Artifacts. (Cloud) We've got a few dozen packages with a variety of versions that I'd like to shove into AzDo Artifacts. It looks like I could do this with powershell and use \MyFileSharePath***.nupkg as the path and it ought grab them all and push each individual version of each package.

Is this a viable approach? Is there a better method I should look into?

This question appears similar but involves all on prem sources. Not sure if that matters.:

Can I upload existing NuGet packages to an Azure DevOps artifacts feed?

Questioner
Ischade
Viewed
0
Krzysztof Madej 2020-11-30 09:03:09

This is valid approach and it is recommended in the documentation

For each share, push all packages in the share to the new feed: nuget push {your package path}*.nupkg -Source {your NuGet package source URL} -ApiKey Azure DevOps Services

You have there also good tip about making your current feed read only

For larger teams, you should consider marking each share as read-only before doing the nuget push operation to ensure no one adds or updates packages during your migration.

Thus I think there is not better way of doing this.