Azure / azure-devops-cli-extension

Azure DevOps Extension for Azure CLI
https://docs.microsoft.com/en-us/cli/azure/ext/azure-devops/?view=azure-cli-latest
MIT License
617 stars 239 forks source link

[Feature Request] All az pipelines variable-group subcommands should support --name argument #1331

Open jikuja opened 1 year ago

jikuja commented 1 year ago

Is your feature request related to a problem? Please describe. All az pipelines variable-group subcommands should support --name argument.

If user wants to update, show, delete variable groups or add, edit or delete group variabled group-id must be known. To fetch group ip user must do extra manual request with CLI.

Describe the solution you'd like Extension should support --name and fetch group id internally

Workaround for batch update

id=$($CMD pipelines variable-group list $AZ_EXTRA_FLAGS --org "$ORG" --project "$PROJECT" --output tsv --query '[?name == `'common'`]'.id)
$CMD pipelines variable-group delete $AZ_EXTRA_FLAGS --org "$ORG" --project "$PROJECT" --group-id $id
$CMD pipelines variable-group create $AZ_EXTRA_FLAGS --org "$ORG" --project "$PROJECT" --name common --variables $COMMON_VARIABLE_GROUP --authorize true