Skip to content

{Keyvault} Migrate azure-mgmt-keyvault to typespec generated SDK#32419

Merged
evelyn-ys merged 4 commits intoAzure:devfrom
evelyn-ys:keyvault_mgmt_typespec
Dec 24, 2025
Merged

{Keyvault} Migrate azure-mgmt-keyvault to typespec generated SDK#32419
evelyn-ys merged 4 commits intoAzure:devfrom
evelyn-ys:keyvault_mgmt_typespec

Conversation

@evelyn-ys
Copy link
Member

@evelyn-ys evelyn-ys commented Nov 13, 2025

Related command

Description

This PR migrates azure-mgmt-keyvault SDK from swagger generated to typespec generated.
For such migration, SDK may have several breaking changes:
https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/mgmt/hybrid_model_migration.md
https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/mgmt/operation_migration.md

Many issues CLI reported to SDK team are tracked here:
Azure/azure-sdk-for-python#43838

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 feature


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

Copilot AI review requested due to automatic review settings November 13, 2025 03:50
@azure-client-tools-bot-prd
Copy link

azure-client-tools-bot-prd bot commented Nov 13, 2025

️✔️AzureCLI-FullTest
️✔️acr
️✔️latest
️✔️3.12
️✔️3.13
️✔️acs
️✔️latest
️✔️3.12
️✔️3.13
️✔️advisor
️✔️latest
️✔️3.12
️✔️3.13
️✔️ams
️✔️latest
️✔️3.12
️✔️3.13
️✔️apim
️✔️latest
️✔️3.12
️✔️3.13
️✔️appconfig
️✔️latest
️✔️3.12
️✔️3.13
️✔️appservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️aro
️✔️latest
️✔️3.12
️✔️3.13
️✔️backup
️✔️latest
️✔️3.12
️✔️3.13
️✔️batch
️✔️latest
️✔️3.12
️✔️3.13
️✔️batchai
️✔️latest
️✔️3.12
️✔️3.13
️✔️billing
️✔️latest
️✔️3.12
️✔️3.13
️✔️botservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️cdn
️✔️latest
️✔️3.12
️✔️3.13
️✔️cloud
️✔️latest
️✔️3.12
️✔️3.13
️✔️cognitiveservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️compute_recommender
️✔️latest
️✔️3.12
️✔️3.13
️✔️computefleet
️✔️latest
️✔️3.12
️✔️3.13
️✔️config
️✔️latest
️✔️3.12
️✔️3.13
️✔️configure
️✔️latest
️✔️3.12
️✔️3.13
️✔️consumption
️✔️latest
️✔️3.12
️✔️3.13
️✔️container
️✔️latest
️✔️3.12
️✔️3.13
️✔️containerapp
️✔️latest
️✔️3.12
️✔️3.13
️✔️core
️✔️latest
️✔️3.12
️✔️3.13
️✔️cosmosdb
️✔️latest
️✔️3.12
️✔️3.13
️✔️databoxedge
️✔️latest
️✔️3.12
️✔️3.13
️✔️dls
️✔️latest
️✔️3.12
️✔️3.13
️✔️dms
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventgrid
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventhubs
️✔️latest
️✔️3.12
️✔️3.13
️✔️feedback
️✔️latest
️✔️3.12
️✔️3.13
️✔️find
️✔️latest
️✔️3.12
️✔️3.13
️✔️hdinsight
️✔️latest
️✔️3.12
️✔️3.13
️✔️identity
️✔️latest
️✔️3.12
️✔️3.13
️✔️iot
️✔️latest
️✔️3.12
️✔️3.13
️✔️keyvault
️✔️latest
️✔️3.12
️✔️3.13
️✔️lab
️✔️latest
️✔️3.12
️✔️3.13
️✔️managedservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️maps
️✔️latest
️✔️3.12
️✔️3.13
️✔️marketplaceordering
️✔️latest
️✔️3.12
️✔️3.13
️✔️monitor
️✔️latest
️✔️3.12
️✔️3.13
️✔️mysql
️✔️latest
️✔️3.12
️✔️3.13
️✔️netappfiles
️✔️latest
️✔️3.12
️✔️3.13
️✔️network
️✔️latest
️✔️3.12
️✔️3.13
️✔️policyinsights
️✔️latest
️✔️3.12
️✔️3.13
️✔️privatedns
️✔️latest
️✔️3.12
️✔️3.13
️✔️profile
️✔️latest
️✔️3.12
️✔️3.13
️✔️rdbms
️✔️latest
️✔️3.12
️✔️3.13
️✔️redis
️✔️latest
️✔️3.12
️✔️3.13
️✔️relay
️✔️latest
️✔️3.12
️✔️3.13
️✔️resource
️✔️latest
️✔️3.12
️✔️3.13
️✔️role
️✔️latest
️✔️3.12
️✔️3.13
️✔️search
️✔️latest
️✔️3.12
️✔️3.13
️✔️security
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicebus
️✔️latest
️✔️3.12
️✔️3.13
️✔️serviceconnector
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicefabric
️✔️latest
️✔️3.12
️✔️3.13
️✔️signalr
️✔️latest
️✔️3.12
️✔️3.13
️✔️sql
️✔️latest
️✔️3.12
️✔️3.13
️✔️sqlvm
️✔️latest
️✔️3.12
️✔️3.13
️✔️storage
️✔️latest
️✔️3.12
️✔️3.13
️✔️synapse
️✔️latest
️✔️3.12
️✔️3.13
️✔️telemetry
️✔️latest
️✔️3.12
️✔️3.13
️✔️util
️✔️latest
️✔️3.12
️✔️3.13
️✔️vm
️✔️latest
️✔️3.12
️✔️3.13

@evelyn-ys evelyn-ys marked this pull request as draft November 13, 2025 03:50
@azure-client-tools-bot-prd
Copy link

azure-client-tools-bot-prd bot commented Nov 13, 2025

️✔️AzureCLI-BreakingChangeTest
️✔️Non Breaking Changes

@github-actions
Copy link

The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR.

Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

@yonzhan
Copy link
Collaborator

yonzhan commented Nov 13, 2025

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

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR migrates the azure-mgmt-keyvault SDK from version 12.1.0 to 13.0.0, which is a TypeSpec-generated SDK version. The migration includes API compatibility changes and adds output transformers to maintain backward compatibility with CLI users.

Key Changes

  • Updated azure-mgmt-keyvault dependency to version 13.0.0 across all platform requirements
  • Changed Permissions parameter from keys to keys_property throughout the codebase to match the new SDK API
  • Added output transformers to convert keysProperty back to keys in CLI output for backward compatibility

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/azure-cli/setup.py Updated azure-mgmt-keyvault version constraint to 13.0.0
src/azure-cli/requirements.py3.windows.txt Updated azure-mgmt-keyvault version to 13.0.0 for Windows
src/azure-cli/requirements.py3.Linux.txt Updated azure-mgmt-keyvault version to 13.0.0 for Linux
src/azure-cli/requirements.py3.Darwin.txt Updated azure-mgmt-keyvault version to 13.0.0 for macOS
src/azure-cli/azure/cli/command_modules/keyvault/custom.py Updated API calls to use keys_property parameter and changed get_sdk to get_models; added .result() calls to vault operations (has critical bugs)
src/azure-cli/azure/cli/command_modules/keyvault/commands.py Added transformer functions to vault commands to maintain output backward compatibility
src/azure-cli/azure/cli/command_modules/keyvault/_transformers.py Added new transformer functions to convert keysProperty to keys in output

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@evelyn-ys
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@evelyn-ys evelyn-ys marked this pull request as ready for review December 17, 2025 02:02
@evelyn-ys evelyn-ys requested a review from bebound as a code owner December 17, 2025 02:02
# so that we don't need to use raw __dict__ directly
if getattr(obj, "_is_model", False):
result = {to_camel_case(attr): todict(getattr(obj, attr), post_processor)
result = {to_camel_case(get_backcompat_attr_name(obj, attr)): todict(getattr(obj, attr), post_processor)
Copy link
Member

Choose a reason for hiding this comment

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

It may be better to add annotation why use get_backcompat_attr_name here so that others could get the context quicly in the future.

Copy link
Member Author

Choose a reason for hiding this comment

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

That will be too long for code comment. I'll explain here so that others can get the context from PR history.

Background is that after migration to typespec generated SDK, models with keys/values/ ... properties breaks. Take keyvault Permission model as an example

Previous model definition:

class Permission:
    keys: [],
    secrets: [],
    certificates: [],
    storage: []

New model definition:

class Permission:
    keys_property: [],
    secrets: [],
    certificates: [],
    storage: []

To keep the original output, azure-core provides new get_backcompat_attr_name func to avoid such keys -> keys_property breaking change

@evelyn-ys evelyn-ys merged commit 3b07475 into Azure:dev Dec 24, 2025
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Auto-Assign Auto assign by bot KeyVault az keyvault

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants