Remove -e short flag from --project-endpoint in AI extensions#7313
Remove -e short flag from --project-endpoint in AI extensions#7313
Conversation
The azure.ai.models and azure.ai.finetune extensions were using -e as a shorthand for --project-endpoint, which conflicts with azd's global -e for --environment. This collision caused #7271 when azd tried to parse -e globally and received a URL instead of an environment name. Drop the -e shorthand entirely from --project-endpoint. Users can still pass the full --project-endpoint flag. The -p shorthand was not usable as a replacement because init commands already use -p for --project-resource-id. Closes #7308 Closes #7309 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Removes the -e shorthand for --project-endpoint in the AI extensions to avoid conflicting with azd’s global -e/--environment flag.
Changes:
- Dropped the
-eshorthand from--project-endpointin bothazure.ai.modelsandazure.ai.finetune. - Switched
StringVarPusages toStringVarfor the affected flags across init and persistent command setups.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| cli/azd/extensions/azure.ai.models/internal/cmd/init.go | Removes -e shorthand from --project-endpoint on the init command. |
| cli/azd/extensions/azure.ai.models/internal/cmd/custom.go | Removes -e shorthand from --project-endpoint on the custom command persistent flags. |
| cli/azd/extensions/azure.ai.finetune/internal/cmd/operations.go | Removes -e shorthand from --project-endpoint on operations persistent flags. |
| cli/azd/extensions/azure.ai.finetune/internal/cmd/init.go | Removes -e shorthand from --project-endpoint on the init command. |
| customCmd.PersistentFlags().StringVarP(&flags.subscriptionId, "subscription", "s", "", | ||
| "Azure subscription ID") | ||
| customCmd.PersistentFlags().StringVarP(&flags.projectEndpoint, "project-endpoint", "e", "", | ||
| customCmd.PersistentFlags().StringVar(&flags.projectEndpoint, "project-endpoint", "", |
There was a problem hiding this comment.
Please don't remove -e, we have some dependency on UI, as UI show the command, which user copy paste, currently, UI is showing -e, change will break the flow.
There was a problem hiding this comment.
@achauhan-scc can we change the UI? Then after the UI is changed we can push this PR.
There was a problem hiding this comment.
Can you please ref the UI you are talking about? I can update that too.
There was a problem hiding this comment.
It is on the foundry portal @achauhan-scc is working on getting it updated and rolled out.
There was a problem hiding this comment.
Thanks @rajeshkamal5050 for the screenshot. @achauhan-scc — once the Foundry portal UI update is rolled out, we can merge this PR. Can you give us a rough timeline for when the UI change will ship? We'll hold this PR until then.
spboyer
left a comment
There was a problem hiding this comment.
Code Review
1. Error messages still reference removed -e shorthand
azure.ai.models/internal/cmd/custom.go:121-122 — Medium
After removing the -e short flag, the error message still says --project-endpoint (-e) and the example command uses -e directly (azd ai models custom list -e https://...). Users following this will get a flag parse error.
Fix: Update the error text and example to use only --project-endpoint.
2. Finetune validation still advertises removed -e
azure.ai.finetune/internal/cmd/validation.go:173 — Medium
The validation error instructs users to provide --project-endpoint (-e) but the shorthand no longer exists.
Fix: Remove (-e) from the message.
3. Fig completion snapshot still lists deleted shorthand
cli/azd/cmd/testdata/TestFigSpec.ts:457 — Medium
The snapshot still contains ['--project-endpoint', '-e'] entries. These need to be regenerated to match the new flag surface, or snapshot tests will fail.
Summary
Removes the
-eshort flag from--project-endpointin bothazure.ai.modelsandazure.ai.finetuneextensions. The-eflag is reserved for azd's global--environmentflag.What changed
Changed
StringVarPtoStringVar(dropped short flag entirely) in 4 files:extensions/azure.ai.models/internal/cmd/custom.go- PersistentFlagsextensions/azure.ai.models/internal/cmd/init.go- Flagsextensions/azure.ai.finetune/internal/cmd/init.go- Flagsextensions/azure.ai.finetune/internal/cmd/operations.go- PersistentFlagsWhy not -p?
We couldn't migrate to
-pbecause it's already used by--project-resource-idin both extensions'init.gofiles. The long form--project-endpointstill works fine.Breaking change
Users who were using
-ewith these extensions will need to use--project-endpointinstead.Closes #7308
Closes #7309
Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com