Repository navigation
[Cognitive Services] az cognitiveservices account adapter-deployment: Add new command group (preview) - #34112
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. |
…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.
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.
|
Cognitive Services |
Updated comment for azure-mgmt-cognitiveservices version.
|
/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.
|
/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.
|
/azp run |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
`az cognitiveservices account compute wait` raised IndexError before sending any request.
Behavior change:
- `compute wait` is now registered with custom_wait_command('wait', 'compute_show') instead of the generic wait_command('wait').
- The generic getter called the decorated SDK ComputesOperations.get with `self` passed as a keyword. The SDK api_version_validation wrapper reads args[0], so it raised IndexError before any HTTP request.
- Polling now goes through compute_show, which calls client.get(...) on the bound client.
Unchanged: no new commands, flags or options. The wait conditions (--created, --updated, --deleted, --exists, --custom, --timeout, --interval) still come from the core wait command. Compute create, delete, show and list are untouched.
Verification:
- Offline, real CLI entry point + real decorated SDK GET, HTTP pipeline mocked: Succeeded + --created exits 0; Failed + --created exits 1 with "The operation failed"; Failed + --exists exits 0; absent + --deleted (GET 404) exits 0.
- Live (manual): wait on a compute in Failed state reaches the GET and reports "The operation failed".
- Not verified: wait --created on a live compute that transitions to Succeeded (create is currently rejected by the backend SKU policy). No regression test is included in this commit.
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
|
🔔 Routing this PR to @Azure/act-experience-enablement-squad. |
X Engineering Agent ReportReview — Comments No confirmed semantic defects found in Azure/azure-cli PR #34112 at
Test validation
Risk assessment — 31/100 · MediumThe Medium rating is driven by public CLI behavior.
Posted by x-engineering-agent (Reviewer) |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
|
saanikaguptamicrosoft A number of recording files were updated. As this is a sdk bump please ensure that you have re-recorded all effected scenario tests to ensure there are no regressions |
|
🔔 Routing this PR to @Azure/act-experience-enablement-squad. |
Re-recorded 21 existing Cognitive Services scenario recordings live with azure-mgmt-cognitiveservices 15.0.0b6 (api-version 2026-09-15-preview), replacing the earlier URL-only api-version edits. All 21 replay offline. The service now returns account locations in lowercase, so tests that created accounts with an uppercase location and asserted the same value now use the lowercase form. Not re-recorded (keep the api-version-only edit): deployment (model gpt-35-turbo 0125 is deprecated), user_owned_storage (account kind Storage is no longer supported), and the two connections from_file tests (data file path fails to load on Windows). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
The 2026-09-15-preview API version is now released, so the note about TIP regions and the pending TSP PR no longer applies. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |


🤖 PR Validation —⚠️ Review suggested
Dependencies
Merge and release of this SDK PR: Azure/azure-sdk-for-python#49463
Related command
az cognitiveservices account adapter-deployment create -g madhurta-uksouth -n manishda-uksouth-resource --adapter-deployment-name saanika-test-adapter-02 --source-model-id "azureai://accounts/manishda-uksouth-resource/projects/manishda-uksouth/models/model_9c2b3d1b-final/versions/1" --target-deployment-name gpt-oss-120baz cognitiveservices account adapter-deployment list -g madhurta-uksouth -n manishda-uksouth-resourceaz cognitiveservices account adapter-deployment show -g madhurta-uksouth -n manishda-uksouth-resource --adapter-deployment-name saanika-test-adapter-02az cognitiveservices account adapter-deployment delete -g madhurta-uksouth -n manishda-uksouth-resource --adapter-deployment-name saanika-test-adapter-02Description
Mirrors the
az cognitiveservices account managed-compute-deploymentpattern from PR #33338. Adds four commands (create/show/list/delete) backed by theadapter_deploymentsoperations group in theazure-mgmt-cognitiveservices15.0.0b6 SDK (TypeSpec source: azure-rest-api-specs#46028).Also updates the existing Compute commands for SDK 15.0.0b6: location is now sent inside properties, --location is optional (falls back to the configured default, then the resource group location), --vm-priority accepts only Regular and Spot, and a new compute wait command is added to fix the linter.
Testing Guide
CLI test setup: https://github.com/Azure/azure-cli/blob/dev/doc/configuring_your_machine.md
The CLI test is done against this SDK PR: [AutoPR azure-mgmt-cognitiveservices]-generated-from-SDK Generation - Python-6940910 azure-sdk-for-python#49463
Confirming testing env (both SDK and CLI are in editable mode):
History Notes
This 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.