Skip to content

[Key Vault] Support control plane API version 2026-02-01 - #33895

Open
Yash (notyashhh) wants to merge 6 commits into
devfrom
yash/keyvault-rbac-api-upgrade
Open

[Key Vault] Support control plane API version 2026-02-01#33895
Yash (notyashhh) wants to merge 6 commits into
devfrom
yash/keyvault-rbac-api-upgrade

Conversation

@notyashhh

Copy link
Copy Markdown
Member

Related command
az keyvault create / update / show / list / recover / purge, az keyvault network-rule, az keyvault private-endpoint-connection, az keyvault region, and Managed HSM control-plane commands.

Description

Upgrades azure-mgmt-keyvault 13.0.014.0.1 so all az keyvault control-plane operations target ARM API version 2026-02-01.

Azure Key Vault is retiring all control-plane API versions earlier than 2026-02-01 on 2027-02-27. The CLI was pinned to 2025-05-01 (via azure-mgmt-keyvault 13.0.0), blocking strategic customers from migrating. Raised as IcM 815108260 and tracked in #33552.

Changes:

  • setup.py + requirements.py3.{Darwin,Linux,windows}.txt: azure-mgmt-keyvault==14.0.1 (its default api-version is 2026-02-01). The control-plane client rides the SDK default (MGMT_KEYVAULT is unpinned in the profile), so no profile change is needed.
  • keyvault/custom.py recover_hsm: use wire-format (camelCase) property keys (tenantId / createMode). The 14.x SDK ships dict-native "hybrid models" that serialize property dicts verbatim, so the previous snake_case keys (tenant_id / create_mode) were dropped from the request body, producing BadRequest: The request does not contain a valid 'TenantId' property. This aligns recover_hsm with the existing recover_vault.
  • Re-recorded all 20 Key Vault module control-plane test cassettes (13 vault + 7 HSM/MHSM) against 2026-02-01.

No user-facing behavior change: the CLI already sends enableRbacAuthorization=true by default, so the only 2025-05-012026-02-01 change (Azure RBAC becoming the service-side default on create) is a no-op for the CLI. RBAC / access-policy logic is intentionally unchanged.

Closes #33552.

Testing Guide

All Key Vault module tests re-recorded live against 2026-02-01 and passing (vault + Managed HSM).

Known follow-up — cross-module test recordings

Because the SDK bump changes the Key Vault control-plane api-version CLI-wide, ~49 test recordings in 16 other modules (vm ×20, network ×7, servicefabric ×5, storage/sql/resource/acs ×2, and 9 more ×1) that create a vault/HSM will fail in playback until their cassettes are updated 2025-05-012026-02-01. The 2026-02-01 control-plane response schema is identical to 2025-05-01 (only the enableRbacAuthorization default changed), so these can be updated by rewriting the Microsoft.KeyVault/{vaults,managedHSMs} request URLs rather than re-recording live. Tracked as a follow-up before this is marked ready.

History Notes

[Key Vault] az keyvault: Support control plane API version 2026-02-01 by upgrading azure-mgmt-keyvault to 14.0.1

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@yonzhan

Copy link
Copy Markdown
Collaborator

Thank you for your contribution! We will review the pull request and get back to you soon.

@notyashhh
Yash (notyashhh) marked this pull request as ready for review August 14, 2026 05:40
@notyashhh
Yash (notyashhh) requested review from a team as code owners August 14, 2026 05:40
Copilot AI lite review requested due to automatic review settings August 14, 2026 05:40
@notyashhh
Yash (notyashhh) requested a review from a team as a code owner August 14, 2026 05:40
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates Azure CLI Key Vault control-plane dependencies and module behavior to target the 2026-02-01 ARM API version (via azure-mgmt-keyvault 14.0.1), aligning with the Key Vault retirement timeline for older control-plane API versions.

Changes:

  • Bumps azure-mgmt-keyvault from 13.0.0 to 14.0.1 in packaging/requirements to pick up the SDK-default 2026-02-01 API version.
  • Adjusts recover_hsm to use wire-format (camelCase) property keys so requests serialize correctly with the 14.x “dict-native” hybrid models.
  • Re-records Key Vault module test cassettes against 2026-02-01.

Reviewed changes

Copilot reviewed 12 out of 25 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/azure-cli/setup.py Updates CLI dependency pin to azure-mgmt-keyvault==14.0.1.
src/azure-cli/requirements.py3.windows.txt Updates Windows requirements pin for azure-mgmt-keyvault.
src/azure-cli/requirements.py3.Linux.txt Updates Linux requirements pin for azure-mgmt-keyvault.
src/azure-cli/requirements.py3.Darwin.txt Updates macOS requirements pin for azure-mgmt-keyvault.
src/azure-cli/azure/cli/command_modules/keyvault/custom.py Fixes Managed HSM recovery request body serialization for SDK 14.x.
src/azure-cli/azure/cli/command_modules/keyvault/tests/latest/recordings/test_mhsm_private_link_resource.yaml Updates recording to api-version=2026-02-01 and new responses.
src/azure-cli/azure/cli/command_modules/keyvault/tests/latest/recordings/test_keyvault_secret_soft_delete.yaml Updates recording to api-version=2026-02-01 and new responses.
src/azure-cli/azure/cli/command_modules/keyvault/tests/latest/recordings/test_keyvault_public_network_access.yaml Updates recording to api-version=2026-02-01 and new responses.
src/azure-cli/azure/cli/command_modules/keyvault/tests/latest/recordings/test_keyvault_private_link_resource.yaml Updates recording to api-version=2026-02-01 and new responses.
src/azure-cli/azure/cli/command_modules/keyvault/tests/latest/recordings/test_keyvault_key_rotation.yaml Updates recording to api-version=2026-02-01 and new responses.
src/azure-cli/azure/cli/command_modules/keyvault/tests/latest/recordings/test_keyvault_hsm_key_release_policy.yaml Updates recording to api-version=2026-02-01 and new responses.
src/azure-cli/azure/cli/command_modules/keyvault/tests/latest/recordings/test_keyvault_certificate_soft_delete.yaml Updates recording content consistent with the re-record.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/azure-cli/setup.py
'azure-mgmt-iothub==5.0.0b1',
'azure-mgmt-iothubprovisioningservices==1.1.0',
'azure-mgmt-keyvault==13.0.0',
'azure-mgmt-keyvault==14.0.1',
Comment on lines 322 to +324
# Use 'Recover' as 'create_mode' temporarily since it's a bug from service side making 'create_mode' case-sensitive
# Will change it back to CreateMode.recover.value('recover') from SDK definition after service fix
# Hybrid models in azure-mgmt-keyvault>=14 are dict-native, so property keys must use wire names (camelCase)
@notyashhh
Yash (notyashhh) requested review from a team and FumingZhang as code owners August 14, 2026 06:02
Upgrade azure-mgmt-keyvault 13.0.0 -> 14.0.1 so az keyvault control-plane commands target ARM API 2026-02-01 (retirement of earlier versions on 2027-02-27). Re-recorded vault control-plane tests. HSM/MHSM test re-recording pending. Related to #33552.
…keyvault 14.x

The 14.x hybrid models serialize property dicts verbatim, so recover_hsm's snake_case keys ({'tenant_id','create_mode'}) were dropped from the wire body, causing 'BadRequest: does not contain a valid TenantId'. Use wire (camelCase) keys like recover_vault. Re-recorded 5/7 HSM/MHSM control-plane tests to 2026-02-01; private_endpoint_connection and mhsm_private_link_resource still pending. Related to #33552.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrade Azure CLI Key Vault module to support API version 2026-02-01

3 participants