Skip to content

Remove -e short flag from --project-endpoint in AI extensions#7313

Open
jongio wants to merge 1 commit intomainfrom
fix/migrate-extensions-off-e
Open

Remove -e short flag from --project-endpoint in AI extensions#7313
jongio wants to merge 1 commit intomainfrom
fix/migrate-extensions-off-e

Conversation

@jongio
Copy link
Member

@jongio jongio commented Mar 25, 2026

Summary

Removes the -e short flag from --project-endpoint in both azure.ai.models and azure.ai.finetune extensions. The -e flag is reserved for azd's global --environment flag.

What changed

Changed StringVarP to StringVar (dropped short flag entirely) in 4 files:

  • extensions/azure.ai.models/internal/cmd/custom.go - PersistentFlags
  • extensions/azure.ai.models/internal/cmd/init.go - Flags
  • extensions/azure.ai.finetune/internal/cmd/init.go - Flags
  • extensions/azure.ai.finetune/internal/cmd/operations.go - PersistentFlags

Why not -p?

We couldn't migrate to -p because it's already used by --project-resource-id in both extensions' init.go files. The long form --project-endpoint still works fine.

Breaking change

Users who were using -e with these extensions will need to use --project-endpoint instead.

Closes #7308
Closes #7309

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

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>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 -e shorthand from --project-endpoint in both azure.ai.models and azure.ai.finetune.
  • Switched StringVarP usages to StringVar for 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", "",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@achauhan-scc can we change the UI? Then after the UI is changed we can push this PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please ref the UI you are talking about? I can update that too.

Copy link
Contributor

@rajeshkamal5050 rajeshkamal5050 Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is on the foundry portal @achauhan-scc is working on getting it updated and rolled out.

image

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member

@spboyer spboyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

azure.ai.finetune: remove -e short flag for --project-endpoint azure.ai.models: remove -e short flag for --project-endpoint

6 participants