3

Pipelines are not getting created when Azure DevOps REST API is used for creation. I have used - Create - Rest API. Please find the request URI and request body used below:

Request : POST https://dev.azure.com/{organization}/{project}/_apis/pipelines?api-version=6.0-preview.1

Request Body:

{
"folder": "",
"name": "pipeline-by-api",
"configuration": {
    "type": "yaml",
    "path": "/azure-pipelines.yml",
    "repository": {
        "id": "00000000-0000-0000-0000-000000000000",
        "name": "repo-by-api",
        "type": "azureReposGit"
    }
}

}

Below is the response received:

{
"$id": "1",
"innerException": null,
"message": "No pool was specified.",
"typeName": "Microsoft.TeamFoundation.Build.WebApi.QueueNotFoundException, Microsoft.TeamFoundation.Build2.WebApi",
"typeKey": "QueueNotFoundException",
"errorCode": 0,
"eventId": 3000

}

Pool is specified in the YAML file as below:

pool:
 name: #######
 demands:
 - maven

If I try to create pipeline manually, it is working successfully. Issue exist only when it is created from Azure DevOps REST API.

8
  • Does your azure-pipelines.yml specify an agent pool? Commented Aug 12, 2021 at 13:22
  • 1
    @TrevorBrooks - Yes It does. I am using a Global Pipeline Template. Hence, agent is defined in the template file. Also, as an update, if I try to create pipeline manually using the same yaml file, it works. With REST API, it is failing. Commented Aug 12, 2021 at 13:25
  • What do you mean by saying Global Pipeline Template? Commented Aug 12, 2021 at 13:45
  • developercommunity.visualstudio.com/t/… Commented Aug 12, 2021 at 14:17
  • @ShaykiAbramczyk - Thanks for the reference. In the quoted query, they were storing agent pool name in variable group/library group which might've caused the issue. here, I am directly mentioning the pool name. Still, I am facing issues. Commented Aug 12, 2021 at 16:04

3 Answers 3

1

I faced the same problem with you: when I used REST API for pipeline creation, it always remind me "No pool was specified." But when I try to create pipeline manually, it works successfully. Maybe you can try to change the REST API version, not using version= 6.0-preview.1, you can set your pipeline Request : POST https://dev.azure.com/{organization}/{project}/_apis/pipelines?api-version=6.1-preview.1

Another question: Did you set your YAML file and specify your pool before creating pipeline by REST API?

Sign up to request clarification or add additional context in comments.

2 Comments

Consider putting a code example on how to change the REST API, and also how to set the YAML file and specify the pool.
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
0

Pipeline creation with Azure DevOps REST API fails with error “No pool was specified”

If you are using the variable for the agent pool name, please try to use hardcoded agentpool name.

AFAIK, the variable are secured and downloaded directly to the agent and cannot be used for pool names since this is needed to be resolved on the server seems a false statement.

You could check this thread for some more details.

1 Comment

I am not using variables for the pool name. The name is hardcoded and is directly given in the pipeline yml file. Still, I am facing the issue.
0

I have been experiencing the same issue and I was able to resolve it by ensuring that a branch in the repository was set as the default branch.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.