Skip to content

Commit 948f710

Browse files
jongioCopilot
andauthored
Deprecate -e short flag for --project-endpoint in AI extensions (#7313)
* Test aks * Remove -e short flag from --project-endpoint in AI extensions 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> * ci: retry transient CI failures * fix: remove leftover -e shorthand references from error messages and docs Clean up error messages, validation text, design spec, and installation guide that still referenced the removed (-e) shorthand for --project-endpoint. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix: add missing color import in detect_confirm_apphost.go * fix: address wbreza review — revert unrelated apphost changes, update remaining -e references in docs Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * ci: retry transient CI failures * fix: deprecate -e shorthand instead of removing it Keep -e working for backward compatibility with existing portal CLI commands and user workflows. Mark it as deprecated via pflag's ShorthandDeprecated so users see a warning nudging them to --project-endpoint. Full removal planned after April 2025. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix: update deprecation date and add models CHANGELOG entry - Update ShorthandDeprecated messages from 'April 2025' to 'a future release' - Add -e deprecation entry to azure.ai.models CHANGELOG Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent a90efeb commit 948f710

9 files changed

Lines changed: 30 additions & 20 deletions

File tree

cli/azd/extensions/azure.ai.finetune/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
## 0.0.16-preview (2026-02-03)
1111

1212
- Simplified init flow: reduced prompts from 4 to 2 for faster setup
13-
- Added implicit init to all job commands: use `--subscription` (`-s`) and `--project-endpoint` (`-e`) flags to configure and run in a single command
13+
- Added implicit init to all job commands: use `--subscription` (`-s`) and `--project-endpoint` flags to configure and run in a single command
1414

1515
## 0.0.14-preview (2026-01-28)
1616

cli/azd/extensions/azure.ai.finetune/internal/cmd/init.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ func newInitCommand(rootFlags rootFlagsDefinition) *cobra.Command {
148148

149149
cmd.Flags().StringVarP(&flags.projectEndpoint, "project-endpoint", "e", "",
150150
"Azure AI Foundry project endpoint URL (e.g., https://account.services.ai.azure.com/api/projects/project-name)")
151+
cmd.Flags().Lookup("project-endpoint").ShorthandDeprecated =
152+
"use --project-endpoint instead; -e will be removed in a future release"
151153

152154
cmd.Flags().StringVarP(&flags.src, "working-directory", "w", "",
153155
"Local path for project output")

cli/azd/extensions/azure.ai.finetune/internal/cmd/operations.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ func newOperationCommand() *cobra.Command {
4343
"Azure subscription ID (enables implicit init if environment not configured)")
4444
cmd.PersistentFlags().StringVarP(&flags.projectEndpoint, "project-endpoint", "e", "",
4545
"Azure AI Foundry project endpoint URL (e.g., https://account.services.ai.azure.com/api/projects/project-name)")
46+
cmd.PersistentFlags().Lookup("project-endpoint").ShorthandDeprecated =
47+
"use --project-endpoint instead; -e will be removed in a future release"
4648

4749
cmd.AddCommand(newOperationSubmitCommand())
4850
cmd.AddCommand(newOperationShowCommand())

cli/azd/extensions/azure.ai.finetune/internal/cmd/validation.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ func validateOrInitEnvironment(ctx context.Context, subscriptionId, projectEndpo
170170

171171
// Environment not configured - check if we have flags for implicit init
172172
if projectEndpoint == "" || subscriptionId == "" {
173-
return fmt.Errorf("required environment variables not set. Either run 'azd ai finetuning init' or provide both --subscription (-s) and --project-endpoint (-e) flags")
173+
return fmt.Errorf("required environment variables not set. Either run 'azd ai finetuning init' or provide both --subscription (-s) and --project-endpoint flags")
174174
}
175175

176176
// Perform implicit initialization

cli/azd/extensions/azure.ai.models/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
## 0.0.5-preview (2026-03-24)
55

6+
- Deprecated `-e` shorthand for `--project-endpoint`; use the full flag name instead
67
- Improved error handling for 403 (Forbidden) during `custom create` upload, with guidance on required roles and links to prerequisites and RBAC documentation (#7278)
78

89
## 0.0.4-preview (2026-03-17)

cli/azd/extensions/azure.ai.models/design/design-spec.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ The `create` command performs three sequential steps internally:
242242
Sets up an azd environment and configures the Azure AI Foundry project connection.
243243
244244
```bash
245-
azd ai models init [-e <endpoint>] [-s <subscription>] [-p <resource-id>] [-n <env-name>]
245+
azd ai models init [--project-endpoint <endpoint>] [-s <subscription>] [-p <resource-id>] [-n <env-name>]
246246
```
247247

248248
**Flow:**
@@ -268,7 +268,7 @@ azd ai models init [-e <endpoint>] [-s <subscription>] [-p <resource-id>] [-n <e
268268
| Flag | Required | Description |
269269
|------|----------|-------------|
270270
| `--subscription, -s` | No | Azure subscription ID |
271-
| `--project-endpoint, -e` | No | Foundry project endpoint URL |
271+
| `--project-endpoint` | No | Foundry project endpoint URL |
272272
| `--project-resource-id, -p` | No | ARM resource ID of the Foundry project |
273273
| `--environment, -n` | No | Name of the azd environment to use |
274274

@@ -338,7 +338,7 @@ azd ai models custom create --name my-model --source ./model-weights/ --base-mod
338338
| `--description` | No | Human-readable description |
339339
| `--base-model` | No | Base model architecture tag (e.g., FW-DeepSeek-v3.1) |
340340
| `--azcopy-path` | No | Explicit path to azcopy binary |
341-
| `--project-endpoint, -e` | No | Override project endpoint (reads from env if not set) |
341+
| `--project-endpoint` | No | Override project endpoint (reads from env if not set) |
342342
| `--subscription, -s` | No | Override subscription ID |
343343

344344
*Either `--source` or `--source-file` is required.
@@ -482,7 +482,7 @@ Custom commands resolve the project endpoint using a 3-tier priority:
482482
┌─────────────────────────────────────────────────────────────────────────────┐
483483
│ Project Endpoint Resolution │
484484
│ │
485-
│ Priority 1: Explicit --project-endpoint (-e) flag │
485+
│ Priority 1: Explicit --project-endpoint flag
486486
│ └─► Use directly, highest priority │
487487
│ │
488488
│ Priority 2: azd environment variables │

cli/azd/extensions/azure.ai.models/docs/installation-guide.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -77,32 +77,32 @@ azd auth login
7777

7878
## Step 5: Use Custom Model Commands
7979

80-
You can use the custom model commands by providing `--project-endpoint (-e)` and `--subscription (-s)` flags directly.
80+
You can use the custom model commands by providing `--project-endpoint` and `--subscription (-s)` flags directly.
8181

8282
### 5.1 List Custom Models
8383

8484
```bash
85-
azd ai models custom list -e <project_endpoint> -s <subscription_id>
85+
azd ai models custom list --project-endpoint <project_endpoint> -s <subscription_id>
8686
```
8787

8888
**Example:**
8989

9090
```bash
91-
azd ai models custom list -e "https://my-account.services.ai.azure.com/api/projects/my-project" -s "8861a79b-1234-5678-abcd-1234567890ab"
91+
azd ai models custom list --project-endpoint "https://my-account.services.ai.azure.com/api/projects/my-project" -s "8861a79b-1234-5678-abcd-1234567890ab"
9292
```
9393

9494
![List Custom Models](images/06.1.jpg)
9595

9696
### 5.2 Create a Custom Model
9797

9898
```bash
99-
azd ai models custom create -e <project_endpoint> -s <subscription_id> --name <model-name> --source <local_path_or_remote_url>
99+
azd ai models custom create --project-endpoint <project_endpoint> -s <subscription_id> --name <model-name> --source <local_path_or_remote_url>
100100
```
101101

102102
**Example with local source:**
103103

104104
```bash
105-
azd ai models custom create -e "https://my-account.services.ai.azure.com/api/projects/my-project" -s "8861a79b-1234-5678-abcd-1234567890ab" --name my-model --source "D:\models\my-weights" --base-model "FW-DeepSeek-v3.1"
105+
azd ai models custom create --project-endpoint "https://my-account.services.ai.azure.com/api/projects/my-project" -s "8861a79b-1234-5678-abcd-1234567890ab" --name my-model --source "D:\models\my-weights" --base-model "FW-DeepSeek-v3.1"
106106
```
107107

108108
**Example with remote source:**
@@ -126,26 +126,26 @@ azd ai models custom create -e "https://my-account.services.ai.azure.com/api/pro
126126
### 5.3 Show Custom Model Details
127127
128128
```bash
129-
azd ai models custom show -e <project_endpoint> -s <subscription_id> --name <model-name>
129+
azd ai models custom show --project-endpoint <project_endpoint> -s <subscription_id> --name <model-name>
130130
```
131131
132132
### 5.4 Delete a Custom Model
133133

134134
```bash
135-
azd ai models custom delete -e <project_endpoint> -s <subscription_id> --name <model-name>
135+
azd ai models custom delete --project-endpoint <project_endpoint> -s <subscription_id> --name <model-name>
136136
```
137137

138138
Use `--force` to skip the confirmation prompt:
139139

140140
```bash
141-
azd ai models custom delete -e <project_endpoint> -s <subscription_id> --name <model-name> --force
141+
azd ai models custom delete --project-endpoint <project_endpoint> -s <subscription_id> --name <model-name> --force
142142
```
143143

144144
---
145145

146146
## Step 6: Initialize Project (Optional — Recommended)
147147

148-
Instead of passing `-e` and `-s` on every command, you can run `azd ai models init` to
148+
Instead of passing `--project-endpoint` and `-s` on every command, you can run `azd ai models init` to
149149
configure your project once. This stores the project endpoint and subscription in the
150150
azd environment so all subsequent commands pick them up automatically.
151151

@@ -161,7 +161,7 @@ The init command will interactively guide you through:
161161
4. Selecting a resource group
162162
5. Selecting your AI Foundry project
163163

164-
After init, you can run commands without `-e` and `-s`:
164+
After init, you can run commands without `--project-endpoint` and `-s`:
165165

166166
```bash
167167
azd ai models custom list
@@ -173,7 +173,7 @@ azd ai models custom delete --name my-model
173173
You can also provide flags during init to skip interactive prompts:
174174

175175
```bash
176-
azd ai models init -e "https://my-account.services.ai.azure.com/api/projects/my-project" -s "8861a79b-1234-5678-abcd-1234567890ab"
176+
azd ai models init --project-endpoint "https://my-account.services.ai.azure.com/api/projects/my-project" -s "8861a79b-1234-5678-abcd-1234567890ab"
177177
```
178178

179179
![Init Command](images/07.jpg)
@@ -194,7 +194,7 @@ azd ai models init -e "https://my-account.services.ai.azure.com/api/projects/my-
194194

195195
| Flag | Short | Description |
196196
|------|-------|-------------|
197-
| `--project-endpoint` | `-e` | Foundry project endpoint URL |
197+
| `--project-endpoint` | `-e` *(deprecated)* | Foundry project endpoint URL |
198198
| `--subscription` | `-s` | Azure subscription ID |
199199
| `--name` | `-n` | Model name |
200200
| `--version` | | Model version (default: "1") |

cli/azd/extensions/azure.ai.models/internal/cmd/custom.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ func newCustomCommand() *cobra.Command {
3838
"Azure subscription ID")
3939
customCmd.PersistentFlags().StringVarP(&flags.projectEndpoint, "project-endpoint", "e", "",
4040
"Azure AI Foundry project endpoint URL (e.g., https://account.services.ai.azure.com/api/projects/project-name)")
41+
customCmd.PersistentFlags().Lookup("project-endpoint").ShorthandDeprecated =
42+
"use --project-endpoint instead; -e will be removed in a future release"
4143

4244
customCmd.AddCommand(newCustomCreateCommand(flags))
4345
customCmd.AddCommand(newCustomListCommand(flags))
@@ -118,8 +120,9 @@ func promptForProject(ctx context.Context, flags *customFlags, azdClient *azdext
118120
var err error
119121
azdClient, err = azdext.NewAzdClient()
120122
if err != nil {
121-
return fmt.Errorf("--project-endpoint (-e) is required when azd is not available.\n\n" +
122-
"Example: azd ai models custom list -e https://<account>.services.ai.azure.com/api/projects/<project>\n\n" +
123+
return fmt.Errorf("--project-endpoint is required when azd is not available.\n\n" +
124+
"Example: azd ai models custom list " +
125+
"--project-endpoint https://<account>.services.ai.azure.com/api/projects/<project>\n\n" +
123126
"Or run 'azd ai models init' to set up your project first")
124127
}
125128
defer azdClient.Close()

cli/azd/extensions/azure.ai.models/internal/cmd/init.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ The init command will:
9494

9595
cmd.Flags().StringVarP(&flags.projectEndpoint, "project-endpoint", "e", "",
9696
"Azure AI Foundry project endpoint URL (e.g., https://account.services.ai.azure.com/api/projects/project-name)")
97+
cmd.Flags().Lookup("project-endpoint").ShorthandDeprecated =
98+
"use --project-endpoint instead; -e will be removed in a future release"
9799

98100
cmd.Flags().StringVarP(&flags.projectResourceId, "project-resource-id", "p", "",
99101
"ARM resource ID of the Foundry project")

0 commit comments

Comments
 (0)