Skip to content

{aimanager} Show ProvisioningState in create/update -o table; add modelsource and model show table output - #10431

Merged
Liqian Luo (circy9) merged 4 commits into
Azure:mainfrom
circy9:aimanager-table-provisioningstate
Oct 6, 2026
Merged

Liqian Luo (circy9) merged 4 commits into
Azure:mainfrom
circy9:aimanager-table-provisioningstate

Conversation

@circy9

@circy9 Liqian Luo (circy9) commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Related command

az aimanager [namespace|modelsource|namespace modeldeployment] create/update, az aimanager modelsource show/list, az aimanager model show/list

Summary

create/update had no table_transformer, so -o table fell back to azure-cli's default table, which drops nested fields such as properties.provisioningState:

$ az aimanager create ... -o table           # before
ETag                                  Location       Name         ResourceGroup
8b890be3-4f12-4612-8ccf-73cea6b2599c  centraluseuap  aimpr10431b  aim-lq-pr10431b
$ az aimanager create ... -o table           # after (same columns as show/list)
Name         ProvisioningState    ResourceGroup    Location
aimpr10431b  Succeeded            aim-lq-pr10431b  centraluseuap

Changes:

  • aimanager, namespace, modeldeployment create/update: reuse the show formatter.
  • modeldeployment create/update: resolve modelId like show does, so the ModelId column is filled. --no-wait is unchanged.
  • modelsource create/update/show/list: new formatter (Name, ProvisioningState, SourceType, Description).
  • model show: new formatter (Name, ModelId, Description). model list moves from a JMESPath string in constants.py to _format.py, with the same output.
  • Version 2.0.1b2, HISTORY.rst entry.

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (pip install azdev required)
  • My extension version conforms to the Extension version schema

Test plan

  • azdev style, azdev linter, test_index.py: pass. azdev test aimanager --series: 113 passed.
  • New unit tests cover the new formatters, modelId resolution on create/update, and a check that every create/update/show/list command has a table formatter.
  • Live before/after run in centraluseuap: results. modeldeployment create timed out in provisioning (covered by unit tests only).

🤖 Generated with Claude Code

…able output

`create`/`update` (aimanager, namespace, modeldeployment) and all `modelsource`
commands had no table_transformer, so `-o table` fell back to azure-cli's
auto-table, which only renders top-level scalars and drops the nested
`properties.provisioningState`. Wire the existing show/list formatters into
create/update and add a modelsource formatter (Name, ProvisioningState,
SourceType, Description).

Co-Authored-By: Claude <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 5, 2026 23:44

@circy9 Liqian Luo (circy9) left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

[Claude Code — Review Agent]

Reviewed 4a479e7. The change is correct and low-risk:

  • --no-wait is safe. azure-cli sets the result to None for supports_no_wait commands and knack skips output, so the transformers never see a poller.
  • The LRO result goes through todict before format_table, so the dict-based formatters get the same shape that show/list already produce.
  • The modelsource keys (provisioningState, sourceType, description) match the vendored SDK rest_field names in both API versions.
  • Bumping to 2.0.1b2 is right, since 2.0.1b1 is already in src/index.json.

I left a few non-blocking comments inline (one UX question and three nits). None of them block merge.

Comment thread src/aimanager/azext_aimanager/commands.py
Comment thread src/aimanager/azext_aimanager/_format.py Outdated
Comment thread src/aimanager/HISTORY.rst Outdated
Comment thread src/aimanager/azext_aimanager/tests/latest/test_aimanager_format.py

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The formatter wiring, implementation, tests, and release metadata are consistent and complete.

Review effort: Balanced
Findings: None

What changed in this PR

Adds consistent table output with ProvisioningState across AI Manager resource commands.

Changes:

  • Applies existing table formatters to create/update commands.
  • Adds and tests model source table formatting.
  • Bumps the extension version and release history.
File Description
src/​aimanager/​setup.py Bumps version to 2.0.1b2.
src/​aimanager/​HISTORY.rst Documents table-output improvements.
src/​aimanager/​azext_aimanager/​commands.py Registers table transformers for affected commands.
src/​aimanager/​azext_aimanager/​_format.py Adds model source formatters.
src/​aimanager/​azext_aimanager/​tests/​latest/​test_aimanager_format.py Tests model source columns and edge cases.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

…ll Description

- modeldeployment create/update now wait for completion and annotate the result
  with the human-readable modelId (as show does), so the ModelId table column is
  populated instead of blank. --no-wait still returns the poller.
- modelsource formatter renders a null description as '' so the column isn't
  dropped (knack drops None cells).
- Add a test that create/update/show/list are wired to table formatters.
- Reword HISTORY: modelsource table output is new, not "same as show/list".

Co-Authored-By: Claude <noreply@anthropic.com>

@circy9 Liqian Luo (circy9) left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

[Claude Code — Review Agent]

Reviewed 7541c63. All 4 earlier comments are addressed. The new wait-then-annotate path matches _grant_caller_roles_on_success and show_modeldeployment. --no-wait still returns the poller, and the existing scenario tests use --no-wait, so they aren't affected. I found no correctness bugs. Two non-blocking nits below.

Comment thread src/aimanager/azext_aimanager/custom.py
Comment thread src/aimanager/azext_aimanager/tests/latest/test_modeldeployment.py
…t annotation routing

Co-Authored-By: Claude <noreply@anthropic.com>

@circy9 Liqian Luo (circy9) left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

[Claude Code — Review Agent] Reviewed 39c75a5 (diff vs 7541c63). Both remaining non-blocking comments are addressed: HISTORY.rst now notes that modeldeployment create/update returns the top-level modelId without --no-wait, and the new test_create_routes_result_through_model_id_annotation test plus the added _annotate.assert_called_once_with(...) in the update test pin the routing through _annotate_model_id_on_completion. No new issues found.

Comment thread src/aimanager/azext_aimanager/commands.py Outdated
Comment thread src/aimanager/azext_aimanager/commands.py Outdated
…py formatter for model list

Replace the AI_MODEL_TABLE_TRANSFORMER JMESPath constant with aimodel_table_format /
aimodel_list_table_format callables in _format.py, matching every other command group,
and wire the single-item formatter to `az aimanager model show`. Add a test that every
create/update/show/list command has a callable table transformer.

Co-Authored-By: Claude <noreply@anthropic.com>
@circy9 Liqian Luo (circy9) changed the title {aimanager} Show ProvisioningState in create/update table output {aimanager} Show ProvisioningState in create/update table output; add modelsource and model show table output Oct 6, 2026
@yonzhan Yong Zhang (yonzhan) added this to the Backlog milestone Oct 6, 2026
@yonzhan

Copy link
Copy Markdown
Collaborator

aimanager

@circy9

Copy link
Copy Markdown
Contributor Author

[Claude Code — Author Agent] Live test results (centraluseuap, real resources)

Each command ran twice against the same resources: once with the released aimanager 2.0.1b1 wheel (before) and once with this PR at 9345ca8 loaded as a dev extension (after). Everything ran with -o table.

Summary

Command Before (2.0.1b1) After (this PR)
aimanager create (re-run on existing) ETag Location Name ResourceGroup Name ProvisioningState ResourceGroup Location
aimanager update ETag Location Name ResourceGroup Name ProvisioningState ResourceGroup Location
aimanager namespace create (re-run) ETag Name ResourceGroup Name ProvisioningState Age Labels
aimanager namespace update ETag Name ResourceGroup Name ProvisioningState Age Labels
aimanager modelsource create (re-run) / update / show / list ETag Name ResourceGroup Name ProvisioningState SourceType Description
aimanager model show Name Name ModelId Description
aimanager model list Name ModelId Description Identical output (61 rows, diff clean)

Other checks with this PR:

  • A new aimanager create, namespace create and modelsource create show the same columns as show/list.
  • update --no-wait prints nothing, as before.
  • A model source with no description (ms2) keeps a blank Description column instead of dropping it.

Pending: namespace modeldeployment create (blocking, to check the ModelId column on create) is still provisioning, so its before/after show/list steps haven't run yet. I'll add them in a follow-up comment.

Raw output

aimanager create (re-run on existing)

# before
ETag                                  Location       Name         ResourceGroup
------------------------------------  -------------  -----------  ---------------
8b890be3-4f12-4612-8ccf-73cea6b2599c  centraluseuap  aimpr10431b  aim-lq-pr10431b
# after
Name         ProvisioningState    ResourceGroup    Location
-----------  -------------------  ---------------  -------------
aimpr10431b  Succeeded            aim-lq-pr10431b  centraluseuap

aimanager update

# before
ETag                                  Location       Name         ResourceGroup
------------------------------------  -------------  -----------  ---------------
2bd22eb3-08e3-49c3-9731-3d3feec63b86  centraluseuap  aimpr10431b  aim-lq-pr10431b
# after
Name         ProvisioningState    ResourceGroup    Location
-----------  -------------------  ---------------  -------------
aimpr10431b  Succeeded            aim-lq-pr10431b  centraluseuap

aimanager namespace create (re-run)

# before
ETag                                  Name    ResourceGroup
------------------------------------  ------  ---------------
fa8e2641-d3e4-497a-a99e-d3f9bab5421f  ns1     aim-lq-pr10431b
# after
Name    ProvisioningState    Age    Labels
------  -------------------  -----  --------
ns1     Succeeded            1m     team=qa

aimanager namespace update

# before
ETag                                  Name    ResourceGroup
------------------------------------  ------  ---------------
130ad576-97e8-42ec-a76d-d334be977533  ns1     aim-lq-pr10431b
# after
Name    ProvisioningState    Age    Labels
------  -------------------  -----  -----------------
ns1     Succeeded            1m     env=after,team=qa

aimanager modelsource create (re-run)

# before
ETag                                  Name    ResourceGroup
------------------------------------  ------  ---------------
20476cb6-806d-4175-ad4b-0bab7a7b10ae  ms1     aim-lq-pr10431b
# after
Name    ProvisioningState    SourceType    Description
------  -------------------  ------------  -------------
ms1     Succeeded            HuggingFace   public HF

aimanager modelsource update

# before
ETag                                  Name    ResourceGroup
------------------------------------  ------  ---------------
0c61217c-e3bb-4713-95d8-74113640dddb  ms1     aim-lq-pr10431b
# after
Name    ProvisioningState    SourceType    Description
------  -------------------  ------------  -------------
ms1     Succeeded            HuggingFace   public HF v3

aimanager modelsource show

# before
ETag                                  Name    ResourceGroup
------------------------------------  ------  ---------------
703ceb6b-9c9e-4436-b57c-8a256e51980d  ms1     aim-lq-pr10431b
# after
Name    ProvisioningState    SourceType    Description
------  -------------------  ------------  -------------
ms1     Succeeded            HuggingFace   public HF v3

aimanager modelsource list

# before
ETag                                  Name    ResourceGroup
------------------------------------  ------  ---------------
56d70028-a85d-468a-8327-fab46a83d07b  ms2     aim-lq-pr10431b
703ceb6b-9c9e-4436-b57c-8a256e51980d  ms1     aim-lq-pr10431b
# after
Name    ProvisioningState    SourceType    Description
------  -------------------  ------------  -------------
ms2     Succeeded            HuggingFace
ms1     Succeeded            HuggingFace   public HF v3

aimanager model show

# before
Name
----------------
9db0bae8f829ff07
# after
Name              ModelId                Description
----------------  ---------------------  --------------------------------------------
9db0bae8f829ff07  google/gemma-4-E4B-it  https://huggingface.co/google/gemma-4-E4B-it

aimanager model list (first 3 of 61 rows; before and after are identical)

Name              ModelId                                         Description
----------------  ----------------------------------------------  ---------------------------------------------------------------------
7aceaf6cdc55136c  microsoft/phi-4                                 https://huggingface.co/microsoft/phi-4
9806f0c862fdd920  microsoft/Phi-4-mini-instruct                   https://huggingface.co/microsoft/Phi-4-mini-instruct
20186bec5294ebaa  deepseek-ai/DeepSeek-R1-Distill-Llama-8B        https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Llama-8B

@circy9 Liqian Luo (circy9) changed the title {aimanager} Show ProvisioningState in create/update table output; add modelsource and model show table output {aimanager} Show ProvisioningState in create/update -o table; add modelsource and model show table output Oct 6, 2026

@xmzhao0822 Ximeng Zhao (xmzhao0822) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks good to me

@circy9
Liqian Luo (circy9) merged commit fcdcefe into Azure:main Oct 6, 2026
24 checks passed
@azclibot

Copy link
Copy Markdown
Collaborator

[Release] Update index.json for extension [ aimanager-2.0.1b2 ] : https://dev.azure.com/msazure/One/_build/results?buildId=184423882&view=results

@circy9

Copy link
Copy Markdown
Contributor Author

[Claude Code — Author Agent] Live test follow-up: namespace modeldeployment

  • modeldeployment create -o table (this PR, blocking): not observed. The deployment (google/gemma-4-E4B-it on Standard_NV36ads_A10_v5) stayed Creating, 0/1 replicas, for 60 min, and the test harness timed the command out. The ModelId-on-create path is covered only by unit tests.
  • modeldeployment show / list: identical before and after, which is expected because this PR doesn't change them:
Namespace    Name    ProvisioningState    Replicas    Age    ModelId                Endpoint
-----------  ------  -------------------  ----------  -----  ---------------------  ---------------------------------------------------------------
ns1          md1     Creating             0/1         1h     google/gemma-4-E4B-it  https://ns1.6ac47ffa6dab830001ad65d1.centraluseuap.aksapp.io/v1

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.

6 participants