2
votes

I'm creating/updating a Release Pipeline in Azure DevOps using REST API and want to update the Release with a specific Agent Pool. In the UI the setting is located under: Release pipeline->Agent job-> Agent Selection-> Agent pool setting.

Currenly I am using the Release definition Creation API, but not sure what parameter to pass within the request, to update the agent pool setting.

Azure DevOps Release Definition Creation API I am using is: https://docs.microsoft.com/en-us/rest/api/azure/devops/release/definitions/create?view=azure-devops-rest-5.1 enter image description here Thank you

1
Do you mean you want to update the Agent Pool setting for a specific Release Pipeline through API?Fairoz
added an image of where I want to access through apiRyguy444222
@Ryguy444222 Did you tried Fairoz 's solution? It seems like it can do it.Levi Lu-MSFT
yup it has worked the queId is indeed the Agent PoolRyguy444222
@Ryguy444222 That's awesome, You can Accept it as an Answer.Levi Lu-MSFT

1 Answers

2
votes

First you need to GET the Agent Queue ID. Below is the API to get the Agent Queue details.

GET https://dev.azure.com/{organization}/{project}/_apis/distributedtask/queues?queueNames={queueNames}&api-version=5.1-preview.1

Once you get this information you will need to use the Pool ID in your JSON request body to create/update your Release definitions using the same API you mentioned in your question.

enter image description here