azd env remove for removing local environment files - #6511
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a new azd env remove command to delete local environment configuration files without removing Azure resources. The command provides both positional and flag-based environment selection, includes confirmation prompts (skippable with --force), and supports the rm alias.
Changes:
- New
azd env removecommand withrmalias for deleting local environment files - Support for both positional argument and
-eflag to specify environment name - Confirmation prompt with
--forceflag to skip - Comprehensive functional tests covering various usage scenarios
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| cli/azd/cmd/env_remove.go | New command implementation with validation, confirmation, and deletion logic |
| cli/azd/cmd/env.go | Command registration and unrelated change to envGetValuesAction |
| cli/azd/test/functional/env_test.go | Functional tests for remove command with multiple scenarios |
| cli/azd/cmd/testdata/TestUsage-azd-env-remove.snap | Snapshot test for command help text |
| cli/azd/pkg/environment/manager.go | Debug print statement added (appears to be leftover) |
a76cd21 to
efb9ad2
Compare
efb9ad2 to
807c8b8
Compare
wbreza
left a comment
There was a problem hiding this comment.
Looks good - just a couple question/observations.
807c8b8 to
63a83d0
Compare
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash: pwsh: WindowsPowerShell install MSI install Standalone Binary
MSI
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
azd env removeNew command to delete local environment config (
.azure/<env>/).--forceto skip confirmation. Does not delete Azure resources. Runazd downfirst if needed.Fixes #937