Skip to content

Commit 634f70c

Browse files
Byow command aliasing (#8095)
* adding more enhancements * releasing v04 preview * updating snapshot * Promote custom model commands to top-level and add new flags - Add top-level azd ai models create/list/show/delete commands - Deprecate 'custom' subgroup with warning message - Add --weight-type flag to create command (default: FullWeight) - Add --source-job-id filter to list command for training job lineage - Make --publisher optional (only sent when explicitly provided) - Send pendingUploadType in startPendingUpload request body - Add new response fields: weightType, baseModel, source, artifactProfile, provisioningState - Display new fields in show command output - Update extension.yaml to 0.0.6-preview with updated examples - Update CHANGELOG.md Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix PollOperation auth: use ai.azure.com scope instead of ml.azure.com The ml.azure.com scope fails with AzureDeveloperCLICredential due to first-party app consent issues. The api.azureml.ms operations endpoint accepts the same ai.azure.com token used by the rest of the client. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Add model update command with description and tag support Add 'azd ai models update' command that uses PATCH with JSON Merge Patch (RFC 7396) to update model description and tags: - --description: set/update the model description - --set-tag key=value: upsert tags (repeatable) - --remove-tag key: remove tags (repeatable) Also adds UpdateModel method to FoundryClient using Content-Type: application/merge-patch+json. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Address PR review: fix deprecated refs, typed errors, tests, cleanup - Update user-facing messages to use top-level commands (azd ai models *) instead of deprecated custom subgroup in code and docs - Fix malformed URI when --base-model is empty (skip DerivedModelInformation) - Replace fragile string-based error detection with typed client.APIError and errors.As status code checking - Handle non-numeric versions in show command's latest-version selection - Preserve existing PreRunE hooks in top-level command setup - Use Flags() instead of PersistentFlags() for leaf commands - Remove unused ARMTokenScope and MLTokenScope constants - Add unit tests for URI utilities and APIError type Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix cspell: replace 'upserts' with 'adds or updates' Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix gofmt: remove trailing whitespace in const block Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fixing version --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent b7e55a5 commit 634f70c

19 files changed

Lines changed: 688 additions & 107 deletions

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,28 @@
33

44
## 0.0.6-preview (Unreleased)
55

6+
### Features
7+
8+
- Added top-level `azd ai models create`, `list`, `show`, `delete` commands as the preferred surface; the `custom` subgroup is now deprecated
9+
- Added `--weight-type` flag to `create` command (default: `FullWeight`)
10+
- Added `--source-job-id` filter to `list` command for querying models by training job lineage
11+
- Added `azd ai models update` command for updating model description and tags (JSON Merge Patch)
12+
- `show` command now displays weight type, provisioning state, source lineage, and artifact profile when available
13+
- `--publisher` flag is now optional (previously defaulted to `Fireworks`); only sent when explicitly provided
14+
615
### Breaking Changes
716

817
- Removed `-e` shorthand for `--project-endpoint`; use `--project-endpoint` instead. This resolves a collision with the azd global `-e/--environment` flag.
918

19+
### Improvements
20+
21+
- `startPendingUpload` request now sends `pendingUploadType: "TemporaryBlobReference"` for explicit upload type declaration
22+
- Model response now supports new fields: `weightType`, `baseModel`, `source`, `artifactProfile`, `provisioningState`
23+
24+
### Deprecations
25+
26+
- `azd ai models custom <command>` is deprecated; use `azd ai models <command>` directly instead
27+
1028
## 0.0.5-preview (2026-03-24)
1129

1230
- Deprecated `-e` shorthand for `--project-endpoint`; use the full flag name instead

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

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ This document outlines a **focused** extension (`azure.ai.models`) that handles
99
| Command | Status | Description |
1010
|---------|--------|-------------|
1111
| `azd ai models init` | ✅ Implemented | Initialize project, environment, and Azure context |
12-
| `azd ai models custom create` | ✅ Implemented | Upload (via AzCopy) + register model |
13-
| `azd ai models custom list` | ✅ Implemented | List all custom models |
14-
| `azd ai models custom show` | ✅ Implemented | Show model details |
15-
| `azd ai models custom delete` | ✅ Implemented | Delete model with confirmation |
12+
| `azd ai models create` | ✅ Implemented | Upload (via AzCopy) + register model |
13+
| `azd ai models list` | ✅ Implemented | List all custom models |
14+
| `azd ai models show` | ✅ Implemented | Show model details |
15+
| `azd ai models delete` | ✅ Implemented | Delete model with confirmation |
1616

1717
## Command Structure
1818

@@ -24,8 +24,8 @@ azd ai models <entity> <action> [options]
2424

2525
| Entity Keyword | Entity | Example |
2626
|----------------|--------|--------|
27-
| `custom` | Custom Model | `azd ai models custom create` |
28-
| `custom deployments` | Custom Model Deployment | `azd ai models custom deployments create` |
27+
| `custom` | Custom Model | `azd ai models create` |
28+
| `custom deployments` | Custom Model Deployment | `azd ai models deployments create` |
2929
| `base` | Base Model | `azd ai models base list` |
3030
| `base deployments` | Base Model Deployment | `azd ai models base deployments create` |
3131

@@ -36,10 +36,10 @@ azd ai models <entity> <action> [options]
3636
| In Scope (Phase 1) — ✅ Implemented | Out of Scope (Future Phases) |
3737
|----------|--------------|
3838
| `azd ai models init` | Custom Model Deployments (Phase 2) |
39-
| `azd ai models custom create` | Base Models (Phase 3) |
40-
| `azd ai models custom list` | Base Model Deployments (Phase 4) |
41-
| `azd ai models custom show` | |
42-
| `azd ai models custom delete` | |
39+
| `azd ai models create` | Base Models (Phase 3) |
40+
| `azd ai models list` | Base Model Deployments (Phase 4) |
41+
| `azd ai models show` | |
42+
| `azd ai models delete` | |
4343

4444
## Entities & Operations
4545

@@ -92,21 +92,21 @@ User-uploaded model weights registered in FDP custom registry.
9292

9393
| Operation | Supported | Command | Description |
9494
|-----------|:---------:|---------|-------------|
95-
| **Create** || `azd ai models custom create` | Upload weights + register model |
96-
| **List** || `azd ai models custom list` | List all custom models |
97-
| **Show** || `azd ai models custom show` | View model details |
98-
| **Delete** || `azd ai models custom delete` | Remove model and weights |
95+
| **Create** || `azd ai models create` | Upload weights + register model |
96+
| **List** || `azd ai models list` | List all custom models |
97+
| **Show** || `azd ai models show` | View model details |
98+
| **Delete** || `azd ai models delete` | Remove model and weights |
9999

100100
#### 2. Custom Model Deployment
101101

102102
Deployed instance of a custom model for inference.
103103

104104
| Operation | Supported | Command | Description |
105105
|-----------|:---------:|---------|-------------|
106-
| **Deploy** || `azd ai models custom deployments create` | Deploy custom model |
107-
| **List** || `azd ai models custom deployments list` | List deployments |
108-
| **Show** || `azd ai models custom deployments show` | View deployment details |
109-
| **Delete** || `azd ai models custom deployments delete` | Remove deployment |
106+
| **Deploy** || `azd ai models deployments create` | Deploy custom model |
107+
| **List** || `azd ai models deployments list` | List deployments |
108+
| **Show** || `azd ai models deployments show` | View deployment details |
109+
| **Delete** || `azd ai models deployments delete` | Remove deployment |
110110

111111
#### 3. Base Model
112112

@@ -162,8 +162,8 @@ Deployed instance of a base model for inference.
162162
│ │ │ │ │ │ │ │ │ │ │ │
163163
│ │ └──────────────┘ └──────────────┘ │ │ └──────────────┘ │ │
164164
│ │ │ │ │ │
165-
│ │ azd ai models custom create │ │ azd ai models │ │
166-
│ │ azd ai models custom list │ │ custom deployments│ │
165+
│ │ azd ai models create │ │ azd ai models │ │
166+
│ │ azd ai models list │ │ custom deployments│ │
167167
│ │ │ │ create │ │
168168
│ └──────────────────────────────────────────┘ └──────────────────┘ │
169169
│ │
@@ -286,28 +286,28 @@ SUCCESS: AI models project initialized!
286286
Resource Group: rg-myproject
287287
288288
You can now use commands like:
289-
azd ai models custom list
290-
azd ai models custom create --name <model-name> --model <path>
289+
azd ai models list
290+
azd ai models create --name <model-name> --model <path>
291291
```
292292

293293
### Write Operations
294294

295295
```bash
296296
# Upload weights AND register model in one step
297-
azd ai models custom create --name <model-name> --source <local-path-or-url> [options]
297+
azd ai models create --name <model-name> --source <local-path-or-url> [options]
298298

299299
# Delete a custom model
300-
azd ai models custom delete --name <model-name> [--force]
300+
azd ai models delete --name <model-name> [--force]
301301
```
302302

303303
### Read Operations
304304

305305
```bash
306306
# List all custom models in the registry
307-
azd ai models custom list [--output table|json]
307+
azd ai models list [--output table|json]
308308

309309
# Show details of a specific custom model
310-
azd ai models custom show --name <model-name> [--output table|json]
310+
azd ai models show --name <model-name> [--output table|json]
311311
```
312312

313313
## Command Details
@@ -317,7 +317,7 @@ azd ai models custom show --name <model-name> [--output table|json]
317317
Combines the upload and register steps into a single user-friendly command.
318318

319319
```bash
320-
azd ai models custom create --name my-model --source ./model-weights/ --base-model FW-DeepSeek-v3.1
320+
azd ai models create --name my-model --source ./model-weights/ --base-model FW-DeepSeek-v3.1
321321
```
322322

323323
**Workflow:**
@@ -348,12 +348,12 @@ are interpreted by the shell. Use `--source-file` to provide a file containing t
348348

349349
```bash
350350
echo "https://account.blob.core.windows.net/container/path?sv=...&sig=..." > source_url.txt
351-
azd ai models custom create --name my-model --source-file source_url.txt
351+
azd ai models create --name my-model --source-file source_url.txt
352352
```
353353

354354
**Output:**
355355
```
356-
$ azd ai models custom create --name my-model --source ./model-weights/ --base-model FW-DeepSeek-v3.1
356+
$ azd ai models create --name my-model --source ./model-weights/ --base-model FW-DeepSeek-v3.1
357357
358358
Using azcopy: C:\Users\user\.azd\bin\azcopy.exe
359359
@@ -382,12 +382,12 @@ Step 2/3: Uploading model files...
382382
### `list` - List Custom Models
383383

384384
```bash
385-
azd ai models custom list [--output table|json]
385+
azd ai models list [--output table|json]
386386
```
387387

388388
**Output (table):**
389389
```
390-
$ azd ai models custom list
390+
$ azd ai models list
391391
392392
NAME VERSION CREATED CREATED BY
393393
my-model 1 2026-02-14T10:30:00Z user@contoso.com
@@ -398,13 +398,13 @@ test-model 1 2026-02-13T08:15:00Z user@contoso.com
398398

399399
**Output (json):**
400400
```bash
401-
azd ai models custom list --output json
401+
azd ai models list --output json
402402
```
403403

404404
### `show` - Show Custom Model Details
405405

406406
```bash
407-
azd ai models custom show --name my-model [--version 1] [--output table|json]
407+
azd ai models show --name my-model [--version 1] [--output table|json]
408408
```
409409

410410
**Flags:**
@@ -417,7 +417,7 @@ azd ai models custom show --name my-model [--version 1] [--output table|json]
417417

418418
**Output:**
419419
```
420-
$ azd ai models custom show --name my-model
420+
$ azd ai models show --name my-model
421421
422422
Custom Model: my-model
423423
──────────────────────────────────────────────────
@@ -451,12 +451,12 @@ To deploy this model, use Azure CLI:
451451
### `delete` - Delete Custom Model
452452
453453
```bash
454-
azd ai models custom delete --name my-model [--version 1] [--force]
454+
azd ai models delete --name my-model [--version 1] [--force]
455455
```
456456

457457
**Output:**
458458
```
459-
$ azd ai models custom delete --name my-model
459+
$ azd ai models delete --name my-model
460460
461461
Delete custom model 'my-model' (version 1)? This action cannot be undone.
462462
Type the model name to confirm: my-model
@@ -593,7 +593,7 @@ Speed: 142 MB/s | Elapsed: 2m 45s | ETA: 5m 20s
593593
#### Interruption Handling
594594

595595
```
596-
$ azd ai models custom create --source ./large-model.bin --name my-model
596+
$ azd ai models create --source ./large-model.bin --name my-model
597597
598598
Uploading model: large-model.bin (120 GB)
599599
━━━━━━━━━━━━━━━━━ 28% (33.6 GB / 120 GB)
@@ -604,7 +604,7 @@ Speed: 98 MB/s | Elapsed: 5m 42s | ETA: 14m 38s
604604
Upload interrupted at 28% (33.6 GB uploaded).
605605
606606
To resume, run the same command again:
607-
azd ai models custom create --source ./large-model.bin --name my-model
607+
azd ai models create --source ./large-model.bin --name my-model
608608
609609
Note: A new SAS token will be obtained, but AzCopy will attempt to resume
610610
from where it left off using its journal files.
@@ -669,7 +669,7 @@ Keep the upload in foreground but **keep user engaged** with:
669669

670670
**Initial Warning:**
671671
```
672-
$ azd ai models custom create --source ./llama-70b.safetensors --name my-llama
672+
$ azd ai models create --source ./llama-70b.safetensors --name my-llama
673673
674674
⚠️ Large file detected: 68.5 GB
675675
Estimated upload time: 8-15 minutes (depending on network speed)
@@ -723,7 +723,7 @@ Model Details:
723723
- Previous partial/orphaned uploads are cleaned up by FDP service (TTL-based)
724724

725725
```
726-
$ azd ai models custom create --source ./llama-70b.safetensors --name my-llama
726+
$ azd ai models create --source ./llama-70b.safetensors --name my-llama
727727
728728
⚠️ Previous upload may exist but was not registered.
729729
Starting fresh upload...
@@ -863,10 +863,10 @@ Implementation follows a **phased approach** across 4 phases, with each phase fo
863863

864864
**Commands Delivered:**
865865
- `azd ai models init`
866-
- `azd ai models custom create`
867-
- `azd ai models custom list`
868-
- `azd ai models custom show`
869-
- `azd ai models custom delete`
866+
- `azd ai models create`
867+
- `azd ai models list`
868+
- `azd ai models show`
869+
- `azd ai models delete`
870870

871871
---
872872

@@ -883,10 +883,10 @@ Implementation follows a **phased approach** across 4 phases, with each phase fo
883883
| **2.3 Delete** | Delete deployment | 🔲 |
884884

885885
**Commands Delivered:**
886-
- `azd ai models custom deployments create`
887-
- `azd ai models custom deployments list`
888-
- `azd ai models custom deployments show`
889-
- `azd ai models custom deployments delete`
886+
- `azd ai models deployments create`
887+
- `azd ai models deployments list`
888+
- `azd ai models deployments show`
889+
- `azd ai models deployments delete`
890890

891891
> **Note:** Until Phase 2, users can deploy custom models using Azure CLI: `az cognitiveservices account deployment create`
892892
@@ -1000,7 +1000,7 @@ az cognitiveservices account deployment delete \
10001000

10011001
```bash
10021002
# Step 1: Upload and register custom model (this extension)
1003-
azd ai models custom create --source ./my-model.safetensors --name my-custom-llama
1003+
azd ai models create --source ./my-model.safetensors --name my-custom-llama
10041004

10051005
# Step 2: Deploy the model (Azure CLI)
10061006
az cognitiveservices account deployment create \

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ func newInitCommand(rootFlags rootFlagsDefinition) *cobra.Command {
193193
### Check: Referenced commands exist
194194
```go
195195
// ❌ FLAGGED: Suggests command that doesn't exist
196-
fmt.Printf(" azd ai models custom register --name %s\n", name)
196+
fmt.Printf(" azd ai models register --name %s\n", name)
197197
```
198198

199199
**Review Comment Template:**

0 commit comments

Comments
 (0)