This issue tracks the implementation of the azdo pipelines variable-group delete command.
Command Description
Delete a variable group from a project. The Azure CLI issues TaskAgentClient.delete_variable_group and prints a success message (source). azdo should provide the same capability with confirmation prompts, consistent output handling, and the shared resolver used by the other variable-group commands.
azdo Command Signature
azdo pipelines variable-group delete [ORGANIZATION/]PROJECT/VARIABLE_GROUP_ID_OR_NAME [--yes]
Flags:
--yes, -y: Skip the confirmation prompt.
- JSON export flags registering
deleted and groupId so automation can detect successful deletions via --json.
Behavior
- Resolve scope and the target group identifier using the shared helper (numeric ID or case-insensitive name lookup with collision checks).
- Start the progress indicator.
- If
--yes is not provided, prompt the user (Delete variable group <name>?). Return util.ErrCancel when declined.
- Call
client.DeleteVariableGroup(project, groupID) and treat non-nil errors as fatal.
- Stop progress before printing output. Table output:
Variable group deleted. JSON output: { "deleted": true, "groupId": <id> }.
- Add debug logging for resolved IDs and confirmation decisions.
Command Wiring
- Implement
internal/cmd/pipelines/variablegroup/delete/delete.go exposing NewCmd(ctx util.CmdContext) *cobra.Command.
- Register it from
internal/cmd/pipelines/variablegroup/variablegroup.go so azdo pipelines variable-group delete is available alongside other variable-group commands.
- Regenerate documentation (
make docs) after wiring.
SDK / Client Requirements
- Requires the Task Agent client (
ClientFactory().TaskAgent(...)). If the client is missing, follow "Handling Missing Azure DevOps SDK Clients" in AGENTS.md.
Tooling & Validation
- Format new Go files with
gofmt/goimports.
- Run
go build ./cmd/azdo/... to ensure the CLI compiles.
- Add/update hermetic tests using mocks (Task Agent client, prompts) and execute
go test ./....
Testing
- Unit tests covering:
- Successful deletion with
--yes.
- Prompt decline returning
util.ErrCancel.
- Lookup by name including collision handling.
- SDK error propagation.
- JSON export structure.
References
This issue tracks the implementation of the
azdo pipelines variable-group deletecommand.Command Description
Delete a variable group from a project. The Azure CLI issues
TaskAgentClient.delete_variable_groupand prints a success message (source).azdoshould provide the same capability with confirmation prompts, consistent output handling, and the shared resolver used by the other variable-group commands.azdoCommand Signatureazdo pipelines variable-group delete [ORGANIZATION/]PROJECT/VARIABLE_GROUP_ID_OR_NAME [--yes]Flags:
--yes, -y: Skip the confirmation prompt.deletedandgroupIdso automation can detect successful deletions via--json.Behavior
--yesis not provided, prompt the user (Delete variable group <name>?). Returnutil.ErrCancelwhen declined.client.DeleteVariableGroup(project, groupID)and treat non-nil errors as fatal.Variable group deleted.JSON output:{ "deleted": true, "groupId": <id> }.Command Wiring
internal/cmd/pipelines/variablegroup/delete/delete.goexposingNewCmd(ctx util.CmdContext) *cobra.Command.internal/cmd/pipelines/variablegroup/variablegroup.gosoazdo pipelines variable-group deleteis available alongside other variable-group commands.make docs) after wiring.SDK / Client Requirements
ClientFactory().TaskAgent(...)). If the client is missing, follow "Handling Missing Azure DevOps SDK Clients" inAGENTS.md.Tooling & Validation
gofmt/goimports.go build ./cmd/azdo/...to ensure the CLI compiles.go test ./....Testing
--yes.util.ErrCancel.References
variable_group_delete