Skip to content

{AKS} Add AI manager model and model source commands - #10208

Open
PugDeveloper wants to merge 4 commits into
Azure:mainfrom
PugDeveloper:swei/aimanager-model-and-modelsource
Open

{AKS} Add AI manager model and model source commands#10208
PugDeveloper wants to merge 4 commits into
Azure:mainfrom
PugDeveloper:swei/aimanager-model-and-modelsource

Conversation

@PugDeveloper

@PugDeveloper PugDeveloper commented Aug 12, 2026

Copy link
Copy Markdown

🤖 PR Validation — ⚠️ Review suggested

Breaking Changes
⚠️ None
⚠️Azure CLI Extensions Breaking Change Test
⚠️aimanager
rule cmd_name rule_message suggest_message
⚠️ 1011 - SubgroupAdd aimanager model sub group aimanager model added
⚠️ 1011 - SubgroupAdd aimanager modelsource sub group aimanager modelsource added

Add the az aimanager model and az aimanager modelsource command groups to the
existing aimanager extension, targeting api-version 2026-05-02-preview.

  • az aimanager model show | list: read-only browse of the location-scoped AI model
    catalog (Microsoft.ContainerService/locations/{location}/aiModels).
  • az aimanager modelsource add | update | list | show | delete | wait: manage
    ModelSource child resources of an AI Manager
    (Microsoft.ContainerService/aiManagers/{name}/modelSources).

Extension version 1.2.0 -> 1.3.0.

az aimanager modelsource update is a full-replace PUT and the credential is write-only
(never returned on GET), so omitting --credential clears any stored credential. This is
documented in the --credential help.

Related command

az aimanager model, az aimanager modelsource

General Guidelines

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

About Extension Publish

Once merged into main, a follow-up PR updates src/index.json automatically. Only update
the version in setup.py and HISTORY.rst; do not modify src/index.json.

Add the az aimanager model (show/list) and az aimanager modelsource (add/update/list/show/delete/wait) command groups for api-version 2026-05-02-preview. Bump extension version to 1.3.0.
Copilot AI lite review requested due to automatic review settings August 12, 2026 19:07
@azure-client-tools-bot-prd

Copy link
Copy Markdown

Hi PugDeveloper,
Please write the description of changes which can be perceived by customers into HISTORY.rst.
If you want to release a new extension version, please update the version in pyproject.toml (or setup.py, if the extension has not migrated yet) as well.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

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.

Pull request overview

Adds new aimanager extension surface area for browsing the location-scoped AI model catalog and managing ModelSource child resources of an AI Manager, targeting api-version 2026-05-02-preview, and bumps the extension version to 1.3.0.

Changes:

  • Introduces az aimanager model {show,list} and az aimanager modelsource {add,update,show,list,delete,wait} command groups wired to the vendored 2026-05-02-preview SDK.
  • Adds custom implementations for model/modelsource operations, plus validators, params, help, and constants for model source types.
  • Adds unit + scenario tests for the new command groups and updates extension versioning (setup/metadata/history).

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/aimanager/setup.py Bumps extension package version to 1.3.0.
src/aimanager/HISTORY.rst Adds release notes for 1.3.0 covering new command groups.
src/aimanager/azext_aimanager/tests/latest/test_modelsource.py Unit tests for ModelSource construction/add/update/delete/list logic.
src/aimanager/azext_aimanager/tests/latest/test_modelsource_scenario.py Scenario-style tests for aimanager modelsource commands via mocked client factory.
src/aimanager/azext_aimanager/tests/latest/test_aimodel_scenario.py Scenario-style tests for aimanager model commands via mocked client factory.
src/aimanager/azext_aimanager/custom.py Implements aimanager model show/list and ModelSource CRUD + ETag match-condition handling.
src/aimanager/azext_aimanager/constants.py Adds ModelSource type constants/enumeration (HuggingFace).
src/aimanager/azext_aimanager/commands.py Registers new command groups and SDK operation templates.
src/aimanager/azext_aimanager/azext_metadata.json Bumps extension metadata version to 1.3.0.
src/aimanager/azext_aimanager/_validators.py Adds non-empty validators for model source and AI model names.
src/aimanager/azext_aimanager/_params.py Adds argument wiring for aimanager model and aimanager modelsource commands.
src/aimanager/azext_aimanager/_help.py Adds help text and examples for the new command groups.
src/aimanager/azext_aimanager/_client_factory.py Adds client factories for ai_models and model_sources operation groups.
Suppressed comments (1)

src/aimanager/azext_aimanager/tests/latest/test_aimodel_scenario.py:41

  • Follow-up to the opaque ai_model_name contract: update the invoked command strings, checks, and mock call assertions to use the same opaque name used in the test model payload.
            self.cmd(
                'aimanager model show -l eastus2 -n phi-4',
                checks=[
                    self.check('name', 'phi-4'),
                    self.check('properties.modelId', 'microsoft/phi-4'),

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

Comment thread src/aimanager/azext_aimanager/_help.py
Comment thread src/aimanager/azext_aimanager/_params.py Outdated
Comment thread src/aimanager/azext_aimanager/tests/latest/test_aimodel_scenario.py Outdated
@xmzhao0822

Copy link
Copy Markdown
Contributor

Please update the PR title as {AKS} Add AI manager model and model source commands

@xmzhao0822

Copy link
Copy Markdown
Contributor

Please fix the CI check failure

Rename test_update_preserves_omitted_properties_and_uses_etag in test_modelsource.py to avoid an azdev --discover collision with the identically named test in test_modeldeployment.py. Address review feedback: az aimanager model uses the service-assigned opaque model name (hex of SHA-256(modelId)); update the help example, --name help, and aimodel scenario test to the canonical name 9806f0c862fdd920 / modelId microsoft/Phi-4-mini-instruct.
@PugDeveloper PugDeveloper changed the title Add AI manager model and model source commands {AKS} Add AI manager model and model source commands Aug 12, 2026
@PugDeveloper

Copy link
Copy Markdown
Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Commenter does not have sufficient privileges for PR 10208 in repo Azure/azure-cli-extensions

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

Comment thread src/aimanager/azext_aimanager/custom.py
update is a full-replace PUT and the credential is write-only, so omitting --credential clears any stored credential. Emit a warning so a description-only update does not silently break authentication.
@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

@yonzhan

Copy link
Copy Markdown
Collaborator

AKS

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

@PugDeveloper

Copy link
Copy Markdown
Author

Aditya Pujara (@a0x1ab) Would you know why the check keep failing and how to fix it?

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