[Cognitive Services] az cognitiveservices account adapter-deployment: Add new command group (preview) - #34112
Open
saanikaguptamicrosoft wants to merge 7 commits into
Conversation
…`: Add new command group (preview) Mirrors the `az cognitiveservices account managed-compute-deployment` pattern from PR Azure#33338. Adds four commands (create/show/list/delete) backed by the `adapter_deployments` operations group in the pre-gen `azure-mgmt-cognitiveservices` 15.0.0b6 SDK from azure-sdk-for-python#49080 (TypeSpec source: azure-rest-api-specs#46028). SDK pin in setup.py intentionally left at ==15.0.0b4; the pin bump lands in a follow-up PR once the SDK releases to PyPI.
|
Hi saanikaguptamicrosoft, |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
microsoft-github-policy-service
Bot
requested review from
Yu Chen (jsntcy),
ZelinWang (wangzelin007) and
Yong Zhang (yonzhan)
September 22, 2026 06:30
…0.0b6 The new SDK release exposes the `adapter_deployments` operation group consumed by the `az cognitiveservices account adapter-deployment` command group added in the previous commit. TypeSpec source: azure-rest-api-specs#46028.
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
One or more issues must be addressed before approval.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 2
Open (3)
What changed in this PR
Adds the preview az cognitiveservices account adapter-deployment CRUD command group, following the managed-compute deployment pattern.
Changes:
- Adds SDK-backed create, show, list, and delete handlers.
- Registers the adapter deployment client factory and command group.
- Adds arguments, help examples, and linter exclusions.
| File | Description |
|---|---|
| src/azure-cli/azure/cli/command_modules/cognitiveservices/linter_exclusions.yml | Updated as part of this pull request. |
| src/azure-cli/azure/cli/command_modules/cognitiveservices/custom.py | Updated as part of this pull request. |
| src/azure-cli/azure/cli/command_modules/cognitiveservices/commands.py | Updated as part of this pull request. |
| src/azure-cli/azure/cli/command_modules/cognitiveservices/_params.py | Updated as part of this pull request. |
| src/azure-cli/azure/cli/command_modules/cognitiveservices/_help.py | Updated as part of this pull request. |
| src/azure-cli/azure/cli/command_modules/cognitiveservices/_client_factory.py | Updated as part of this pull request. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…`: Add unit and scenario tests Adds `test_adapter_deployment.py` mirroring the two-tier pattern from PR Azure#33759 (`test_compute.py`). `CognitiveServicesAdapterDeploymentUnitTests` runs in every CI job with mocked clients and verifies the create wire-payload shape (properties carrying sourceModelId and targetDeploymentName, no sku/tags), that read-only fields don't leak onto outbound payloads, and the LRO return-poller contract for create/delete. `CognitiveServicesAdapterDeploymentScenarioTests` is decorated `@live_only()` and covers the full create/show/list/delete lifecycle end-to-end; skipped in normal CI, requires AZURE_TEST_RUN_LIVE=True plus a pre-provisioned Foundry account, base MCD, and LoRA-fine-tuned Project Model. Placeholder resource identifiers are marked TODO pending service-team access.
Collaborator
|
Cognitive Services |
Updated comment for azure-mgmt-cognitiveservices version.
Member
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
…nt for accuracy The prior comment (inherited from PR Azure#33338 / PR Azure#33759) named a single feature (compute) and a single preview stage (PrPr) as the reason for the beta pin. That is factually incomplete: the beta pin is required because the cognitiveservices CLI module depends on multiple preview-only features that span both PuPr (managed-compute-deployment, adapter-deployment) and PrPr (compute), and preview TypeSpec surfaces only ship in beta SDKs (stable SDKs are generated from GA-only API versions). Downgrading to a stable SDK would break all of them at once, not just compute. Revised comment reflects the union rather than singling out one feature or stage.
Member
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
…9-15-preview` SDK `azure-mgmt-cognitiveservices==15.0.0b6` (pinned in an earlier commit on this branch) emits `api-version=2026-09-15-preview` by default for all cognitiveservices operation groups. Every existing recording still targets `2026-05-15-preview` (the default in 15.0.0b4), which would cause vcrpy playback to fail on URL mismatch for all 20+ cognitiveservices scenario tests. This is a URL-only find-replace across 25 recording files (182 URLs); response bodies are untouched. Assumes the API-version diff between the two preview versions is additive for the operations these tests exercise. If any test fails on payload-schema mismatch after the SDK PyPI release lands, that specific recording will need to be re-recorded live in a follow-up.
Member
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
…r `doc/authoring_tests.md` Rewrites the scenario class to comply with the `Test Policies` section of `doc/authoring_tests.md` (DO NOT USE hard-coded or otherwise persistent resources — create resources per-test, tear down after). Matches the pattern used by `test_compute.py` from PR Azure#33759. Changes: - Drop the `TEST_ACCOUNT` / `TEST_TARGET_DEPLOYMENT` / `TEST_SOURCE_MODEL_ID` REPLACE_WITH_* placeholders — no hardcoded resource names remain. - `test_adapter_deployment_list_empty` uses `@ResourceGroupPreparer` + `self.create_random_name` + inline `az cognitiveservices account create` (Foundry AIServices kind, project-management enabled) to provision a fresh account, calls `adapter-deployment list`, asserts empty array, tears down. Recordable end-to-end. - `test_adapter_deployment_create_show_list_delete` decorated `@live_only()` at the method level and gated by `unittest.skipUnless` on four env vars (`CLITEST_ADAPTER_RESOURCE_GROUP`, `CLITEST_ADAPTER_ACCOUNT`, `CLITEST_ADAPTER_TARGET_DEPLOYMENT`, `CLITEST_ADAPTER_SOURCE_MODEL_ID`). Skipped when env vars are unset. Not recorded because the referenced `sourceModelId` and `targetDeploymentName` are site-specific. - Class-level `@live_only()` retained for now (mirrors `test_compute.py` from PR Azure#33759). Will lift once recordings are captured against a TIP-family subscription in a follow-up. Unit tests unchanged; all 6 continue to pass locally.
Member
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Mirrors the
az cognitiveservices account managed-compute-deploymentpattern from PR #33338. Adds four commands (create/show/list/delete) backed by theadapter_deploymentsoperations group in the pre-genazure-mgmt-cognitiveservices15.0.0b6 SDK from azure-sdk-for-python#49080 (TypeSpec source: azure-rest-api-specs#46028). SDK pin in setup.py intentionally left at ==15.0.0b4; the pin bump lands in a follow-up PR once the SDK releases to PyPI.Related command
Description
Testing Guide
History Notes
[Component Name 1] BREAKING CHANGE:
az command a: Make some customer-facing breaking change[Component Name 2]
az command b: Add some customer-facing featureThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.