Azure / Azure/azure-devops-cli-extension
[Bug] az pipelines variable delete does not work with —variable-name
- Dominant language
- Python
- Stars
- 682
- Forks
- 278
- Avg merge
- 3d 23h
- Merged PRs (30d)
- 3
Description
**Describe the bug**
Running:
```sh
$: az pipelines variable delete —pipeline-name “foo” —name “var_name” # rest of parameters
```
does not work. However, running:
```sh
$: az pipelines variable delete —pipeline-id $id —name “var_name” # rest of parameters
```
does. This works as intended when one runs `az pipelines variable create`.
`—pipeline-name` seems to be a supported parameter when running `az pipelines variable delete —help`.
Upon looking at `—debug`, it seems that the client tries to do this:
```
DEBUG: urllib3.connectionpool: https://dev.azure.com:443 “GET /org_name/project_name/_apis/build/Definitions?name=foo
```
instead of this
```
DEBUG: urllib3.connectionpool: https://dev.azure.com:443 “GET /org_name/project_name/_apis/build/Definitions/$id?name=foo
```
**To Reproduce**
Azure Cli Version: 2.8.0
Azure-Devops extension version: 0.18.0
Steps to reproduce the behavior:
1. Create a pipeline; doesn’t matter how.
2. Create a variable: `AZURE_DEVOPS_EXT_PAT=pat az pipelines variable create —name foo —project project —org https://dev.azure.com/org —pipeline-name pipeline —value bar`
3. Delete that variable: `AZURE_DEVOPS_EXT_PAT=pat az pipelines variable delete —name foo —project project —org https://dev.azure.com/org —pipeline-name pipeline`
**Expected behavior**
The variable should get deleted.
Contributor guide
Assessment
This issue has not been assessed yet.