Azure devops rest api is giving me only few releases information.?

55 Views Asked by At

I have powershell code where I am trying to fetch the releases using azure devops rest api and able to do it successfully I am using below rest Api. Only the issue which I am facing is when I check from azure portal it is having more releases of that particular deployments whereas rest api is giving me only top 6-7 release information?

GET https://vsrm.dev.azure.com/fabrikam/A13d3daac-03b8-4a23-9cc4-2c3de65dab63/_apis/release/deployments?definitionId=38&api-version=7.1-preview.2

Could someone tell me why this behavior?

2

There are 2 best solutions below

2
Shamrai Aleksander On

What exactly are you trying to fetch? You may get a list of releases here: Releases - List.

GET 
https://vsrm.dev.azure.com/{organization}/{project}/_apis/release/releases?definitionId={definitionId}&api-version=7.2-preview.8

In your case, you are trying to get deployments. Deployments show each deployment (or redeployment) into each environment of a particular release definition.

0
rince_antony On

The reason why you are not getting all the releases under a release definition is because the API is paginating the results. You can use $top and continuationToken to get all the releases of the release definition.

This is an example for a different requirement for your reference