Search code examples
azureazure-devopsadocicdazure-artifacts

Is there a way to get more than 1000 Packages and versions from Azure DEVOPs Feed RESTAPI for GET Packages?


Is there a way to get more than 1000 Packages and versions from Azure DEVOPs Feed RESTAPI for GET Packages? I have around 1400 ADO NUGET Packages and its versions to migrate. I am running the REST API documented here: https://learn.microsoft.com/en-us/rest/api/azure/devops/artifacts/artifact-details/get-packages?view=azure-devops-rest-7.1 using Python. It is limiting at 1000 packages without any warning. It is nowhere documented as well.

The HTTP Response header parameter x-ms-continuationtoken for response continuity is not there in the API version 7.1.

How can I get the details and download all the ADO Packages?


Solution

  • The REST API that you are using has a skip parameter. So you can get all 1400 by calling it twice.

    • First call returns the first 1000 packages
    • In the second call set the value of skip to 1000, it will then return the remaining 400