Repository navigation
[Cognitive Services] az cognitiveservices account create: Add BYO AKS agent hosting support - #34303
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8ad0ac21-86e7-465c-a642-adf09ac26cb9
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8ad0ac21-86e7-465c-a642-adf09ac26cb9
…on rules Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8ad0ac21-86e7-465c-a642-adf09ac26cb9
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 775adbaa-4b8a-46b0-8f77-d6e24e8b87f8
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 775adbaa-4b8a-46b0-8f77-d6e24e8b87f8
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 775adbaa-4b8a-46b0-8f77-d6e24e8b87f8
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 775adbaa-4b8a-46b0-8f77-d6e24e8b87f8
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 775adbaa-4b8a-46b0-8f77-d6e24e8b87f8
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 5c6dbffd-c51b-4f82-8506-5e50e85e5a52
Expose subnet as a non-preview account create option and build network injection independently. Update planning, help, and regression coverage. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
Thank you for your contribution jessie zhu (@jessiezhu-m)! We will review the pull request and get back to you soon. |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
🟡 Changes recommended
Preflight incorrectly rejects valid cluster- and account-scoped permissions and fails to catch existing-account location mismatches before creating dependencies.
3 open issues
What changed in this PR
Adds preview support for customer-owned AKS agent hosting to az cognitiveservices account create, extending the existing account-creation flow with prerequisite validation and dependency preparation.
Changes:
- Adds four agent-hosting arguments, identity aliases, and a usage example.
- Validates prerequisites before creating or reusing dependencies and configuring role assignments.
- Adds payload, argument, preflight, provisioning, and failure-isolation tests while preserving non-hosting behavior.
| File | Description |
|---|---|
src/azure-cli/azure/cli/command_modules/cognitiveservices/tests/latest/test_agent_hosting.py |
Tests arguments, hosting payloads, and existing behavior. |
src/azure-cli/azure/cli/command_modules/cognitiveservices/tests/latest/test_agent_hosting_preparation.py |
Tests validation, permissions, provisioning, and failure isolation. |
src/azure-cli/azure/cli/command_modules/cognitiveservices/custom.py |
Integrates dependency preparation and hosting configuration into account creation. |
src/azure-cli/azure/cli/command_modules/cognitiveservices/_params.py |
Registers preview hosting arguments and identity aliases. |
src/azure-cli/azure/cli/command_modules/cognitiveservices/_help.py |
Adds an AKS hosting example. |
src/azure-cli/azure/cli/command_modules/cognitiveservices/_client_factory.py |
Provides management clients for hosting prerequisites. |
src/azure-cli/azure/cli/command_modules/cognitiveservices/_agent_hosting.py |
Creates or reuses dependencies and configures role assignments. |
src/azure-cli/azure/cli/command_modules/cognitiveservices/_agent_hosting_preflight.py |
Implements read-only resource and permission validation. |
Review effort: Balanced
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
|
Yong Zhang (@yonzhan) Can you or your team member help review this pr? We target to catch up the upcoming release. |
|
Adding mansoor sarfraz (@msarfraz) to help with |
mansoor sarfraz (msarfraz)
left a comment
There was a problem hiding this comment.
Looks good overall.
Non-blocking: (1) the node-pool preflight lists all compute SKUs for the region, which can take a while, so consider an info log or a help note about the wait. (2) Please add a short comment explaining the two new pylint disables (too-many-instance-attributes, too-many-locals). (3) The hard-coded Kata image baseline 202608.14.0 and Kubernetes 1.31 will need updating as the service evolves, so a link to the source of truth in a code comment would help. (4) A recorded or live scenario would be a good follow-up before GA.

🤖 PR Validation —⚠️ Review suggested
This PR adds warning or check suppressions. Fix the underlying warning where possible and justify each remaining suppression in a code comment or the PR description.
2 added suppressions
src/azure-cli/azure/cli/command_modules/cognitiveservices/_agent_hosting_preflight.pyclass PreflightResult: # pylint: disable=too-many-instance-attributessrc/azure-cli/azure/cli/command_modules/cognitiveservices/custom.pydef create( # pylint: disable=too-many-localsRelated command
az cognitiveservices account createDescription
Add preview support for customer-owned AKS agent hosting when creating an Azure AI Services account.
--agent-hosting-*arguments for the AKS cluster, Storage account, hosting-management identity, and workload identity.networkInjectionssupport in this change.Testing Guide
azdev test test_agent_hosting test_agent_hosting_preparation --discoverequivalent targeted pytest run: 86 passed, 139 subtests passed.azdev style cognitiveservices: passed.azdev linter cognitiveservices: passed with no violations.az cognitiveservices account create --help: verified the four--agent-hosting-*arguments are present and--agent-subnetis absent.Focused tests are included in:
src/azure-cli/azure/cli/command_modules/cognitiveservices/tests/latest/test_agent_hosting.pysrc/azure-cli/azure/cli/command_modules/cognitiveservices/tests/latest/test_agent_hosting_preparation.pyHistory Notes
The history note will be generated from the PR title.
Manual Tests


This checklist is used to make sure that common guidelines for a pull request are followed.