Reputation: 28306
I installed the preview release of the Azure DevOps CLI
extension and verified its installation. I set some defaults using az devops configure --defaults organization=https://dev.azure.com/XXX project="XXX"
. I can trigger a release using az pipelines release create --definition-name "XXX"
. Based on that, it seems that my installation is good and I should be able to do what I'm attempting. BTW, I'm using the Cloud Shell in the Azure Portal for this but will eventually move my work to Azure CLI Tasks in classic Release Pipelines.
When I run the following:
az pipelines variable update --org https://dev.azure.com/XXX --project "XXX" --pipeline-name "XXX" --name "var_name" --value "var_value"
I get the following message:
There were no build definitions matching name "XXX" in project "XXX".
And I get the same message when I run the following:
az pipelines variable list --org https://dev.azure.com/XXX--project "XXX" --pipeline-name "XXX"
One problem, the message references build definitions. I didn't specify a build definition. It is a classic (pre-YAML) release definition and it definitely exists.
Should I be able to access and manipulate release pipeline variables using this extension? The extension's docs page makes no reference to build or release definitions.
Upvotes: 1
Views: 824
Reputation: 40603
Thi CLI option is for pipelines not for releases. You can pick one of two possible workaraound.
az devops invoke --org https://dev.azure.com/thecodemanual/ --area release --resource definitions --http-method Put --route-parameters project="DevOps Manual" definitionId=7 --in-file 9.json --api-version 5.1
in 9.json
I have release definition get via this endpoint
https://vsrm.dev.azure.com/{{organization}}/{{project}}/_apis/release/definitions/7?api-version=6.1-preview.4
with modified variables section:
"variables": {
"ReleaseVersion": {
"value": "Version-from-cli"
}
},
Please be aware that stage scope variables appears in stage definition scope.
az pipelines variable-group variable update --group-id
--name
[--detect {false, true}]
[--new-name]
[--org]
[--project]
[--prompt-value {false, true}]
[--secret {false, true}]
[--value]
Upvotes: 1