Repository navigation
Conversation
… deployments Add azure_rm_cognitiveservicesdeployment and azure_rm_cognitiveservicesdeployment_info to manage model deployments within an Azure AI Services / Azure OpenAI (Cognitive Services) account, addressing the deployment half of epic ACA-4375. The account half is already covered by azure_rm_cognitiveservicesaccount (kind=OpenAI); an OpenAI EXAMPLES block is added there to document the workflow. The deployment module is idempotent and supports check mode. Because begin_create_or_update issues a PUT (full replace), updates carry forward the existing model/sku the user did not resupply, and comparison is done against a copy so default_compare's mutation cannot leak read-only keys into the PUT body. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Create an OpenAI account, then create/idempotent/info-get/info-list/update/delete a text-embedding-3-small deployment, asserting idempotency on re-create and re-delete. Uses a GenerallyAvailable model so the live test is not broken by model-version deprecation. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…r-pipelines Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
|
||
| return changed | ||
|
|
||
| def _merge_for_update(self, existing, params): |
There was a problem hiding this comment.
_merge_for_update only keeps the existing model and sku. Update is a full-replace PUT, so changing capacity without repeating these settings resets them. Consider carry forward every writable property.
There was a problem hiding this comment.
Good catch, thanks — fixed in 40a6cd01.
_merge_for_update now carries forward every writable property the user did not resupply, not just model/sku. It copies all existing properties except the SDK's read-only fields (provisioning_state, capabilities, call_rate_limit, rate_limits, dynamic_throttling_enabled, and current_capacity), plus sku/tags. So a capacity-only update no longer resets rai_policy_name, version_upgrade_option, etc.
I also strengthened the integration test to prove it: it now creates the deployment with a non-default version_upgrade_option: NoAutoUpgrade, then updates only the capacity and asserts model and version_upgrade_option survive the PUT. Live run in eastus passes (ok=24 failed=0); the update response shows capacity: 2 with version_upgrade_option still NoAutoUpgrade.
Note begin_update (PATCH) can't be used as an alternative here — its body is PatchResourceTagsAndSku, so it only supports tags/sku, not model/rai_policy_name/version_upgrade_option.
…s on update Addresses review feedback: begin_create_or_update is a full-replace PUT, so an update that changes only the capacity must not reset the other writable properties. _merge_for_update now carries forward every writable property the user did not resupply (model, rai_policy_name, version_upgrade_option, and any other writable keys), excluding the SDK's read-only fields (provisioning_state, capabilities, call_rate_limit, rate_limits, dynamic_throttling_enabled, current_capacity). The integration test now sets a non-default version_upgrade_option on create, updates only the capacity, and asserts model + version_upgrade_option survive. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
SUMMARY
Adds two new modules to manage Azure OpenAI / Azure AI (Cognitive Services) model
deployments, addressing the deployment half of the "Automate Generative AI with
Azure OpenAI" work:
azure_rm_cognitiveservicesdeployment— create, update, and delete a modeldeployment within a Cognitive Services / Azure OpenAI account. Idempotent and
supports check mode.
azure_rm_cognitiveservicesdeployment_info— get a specific deployment or listall deployments in an account.
The top-level account is already fully managed by
azure_rm_cognitiveservicesaccount(
kind: OpenAI, sku, network rules, custom subdomain, tags), so no new accountmodule is introduced; an Azure OpenAI EXAMPLES block is added there to document
the end-to-end workflow.
Implementation notes:
cognitive_services_management_client.deploymentsoperations.begin_create_or_updateis a PUT (full replace), so on update the module carriesforward the existing model/sku the user did not resupply, and compares desired
state against a copy (so
default_compare's in-place mutation cannot leakread-only fields such as
provisioning_stateinto the PUT body).modelis required only when creating a deployment.Live integration was validated in
eastus(create, idempotent re-run, infoget/list, capacity update, delete, idempotent delete; all assertions passed) using
a GenerallyAvailable model so the test is not broken by model-version deprecation.
ISSUE TYPE
New Module Pull Request
COMPONENT NAME
azure_rm_cognitiveservicesdeployment
azure_rm_cognitiveservicesdeployment_info
ADDITIONAL INFORMATION
The CI service principal needs permission to create Azure OpenAI accounts and
model deployments (OpenAI quota in the test subscription/region).
Assisted-by: Claude Opus 4.8 (Anthropic)