Azure / Azure/azure-devops-cli-extension

[Bug] az pipeline create fails intermittently

Open
#1,031 1 comment 1 reaction 0 assignees View on GitHub
Area: ProToCol bug
Dominant language
Python
Stars
682
Forks
278
Avg merge
3d 23h
Merged PRs (30d)
3

Description

**Describe the bug**

I am trying to create an Azure DevOps Pipelines pipeline with the CLI. I am attempting to do this with a PAT. The PAT has full access to all services offered within the Azure DevOps project into which the pipeline is being deployed.

This was not working for me earlier today. When I ran:

```sh
$: (reverse-i-search)`az pip': AZURE_DEVOPS_EXT_PAT=$PAT_TOKEN az pipelines create --name "Kubernetes Cluster - Demo" --description "Test that AKS builds for me" --branch master --org https://dev.azure.com/$project_id --project "AKS Demo" --service-connection "Development" --yaml-path $path_to_yaml --repository "AKS Demo" --repository-type tfsgit
```

I got this error:

```sh
ERROR: The requested resource requires user authentication: https://dev.azure.com/$project_id/AKS%20Demo/_apis/distributedtask/queues
```

Issuing a `GET` request to that URL gave me a 403 whereas `GET`ing to `/_apis/repos/` succeeds with a `200` and a list of repositories this PAT has access to.

When I tried this again a few hours later, `az pipeline create` succeeded. Additionally, `GET`ing `/_apis/distributedtask/queues` returned a 200 with a list of Pipelines agents my pipeline can use.

This is surprising.

**To Reproduce**

See above.

** Azure CLI Version **
```
$: az version
{
"azure-cli": "2.8.0",
"azure-cli-command-modules-nspkg": "2.0.3",
"azure-cli-core": "2.8.0",
"azure-cli-nspkg": "3.0.4",
"azure-cli-telemetry": "1.0.4",
"extensions": {
"azure-devops": "0.18.0"
}
}
```

**Expected behavior**

I expected either `/_apis/distributedtask/queues` to succeed with a `200` or fail with a `500` if it was experiencing issues.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.