{AKS} Add AI manager model and model source commands - #10208
{AKS} Add AI manager model and model source commands#10208PugDeveloper wants to merge 4 commits into
Conversation
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.
|
Hi PugDeveloper, |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
There was a problem hiding this comment.
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}andaz 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_namecontract: 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.
|
Please update the PR title as {AKS} Add AI manager model and model source commands |
|
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.
|
/azp run |
|
Commenter does not have sufficient privileges for PR 10208 in repo Azure/azure-cli-extensions |
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
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.
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
|
AKS |
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
|
Aditya Pujara (@a0x1ab) Would you know why the check keep failing and how to fix it? |
🤖 PR Validation —⚠️ Review suggested
Add the
az aimanager modelandaz aimanager modelsourcecommand groups to theexisting
aimanagerextension, targeting api-version 2026-05-02-preview.az aimanager model show | list: read-only browse of the location-scoped AI modelcatalog (Microsoft.ContainerService/locations/{location}/aiModels).
az aimanager modelsource add | update | list | show | delete | wait: manageModelSource child resources of an AI Manager
(Microsoft.ContainerService/aiManagers/{name}/modelSources).
Extension version 1.2.0 -> 1.3.0.
az aimanager modelsource updateis 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 modelsourceGeneral Guidelines
azdev style <YOUR_EXT>locally?python scripts/ci/test_index.py -qlocally?About Extension Publish
Once merged into main, a follow-up PR updates
src/index.jsonautomatically. Only updatethe version in setup.py and HISTORY.rst; do not modify
src/index.json.