[Key Vault] Added ExternalKey model, create_external_key method, external_key property#47200
Open
ncamillucci wants to merge 6 commits into
Open
[Key Vault] Added ExternalKey model, create_external_key method, external_key property#47200ncamillucci wants to merge 6 commits into
ncamillucci wants to merge 6 commits into
Conversation
ae7bf29 to
bae1660
Compare
bae1660 to
92a7c54
Compare
92a7c54 to
56778a1
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Introduces External Key Management (EKM) support to azure-keyvault-keys so Managed HSM keys can reference key material owned by an external HSM. The new public surface is the ExternalKey model, KeyClient.create_external_key (sync + async), and the read-only KeyProperties.external_key property, all gated on the 2026-01-01-preview API version and Managed HSM. The PR also bundles unrelated generated-utility performance changes (scalar fast paths in serialization.Deserializer.__call__, XML field plan caching, and rest_field(deserializer=...) support) that are not mentioned in the description or CHANGELOG.
Changes:
- Add
ExternalKeymodel,KeyClient.create_external_key(sync/async), andKeyProperties.external_key, plumbed through_get_attributesandKeyAttributes.external_key. - Add sync/async unit tests and
[START/END create_external_key]snippet tests gated on Managed HSM + default API version, includingEKM_EXTERNAL_IDsanitization and preparer plumbing. - Add
external_key_operations.py/..._async.pysamples and unrelated generated-layer perf changes in_generated/_utils/{serialization,model_base}.py.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| azure/keyvault/keys/init.py | Export ExternalKey from the public package. |
| azure/keyvault/keys/_models.py | Add ExternalKey model and KeyProperties.external_key property. |
| azure/keyvault/keys/_client.py | Import ExternalKey, extend _get_attributes, add create_external_key. |
| azure/keyvault/keys/aio/_client.py | Async mirror of _get_attributes and create_external_key. |
| azure/keyvault/keys/_generated/_utils/serialization.py | Adds scalar fast path to Deserializer.__call__ (unrelated to ExternalKey). |
| azure/keyvault/keys/_generated/_utils/model_base.py | Adds XML scalar deserializers, _xml_field_plan, and rest_field(deserializer=...) (unrelated to ExternalKey). |
| tests/conftest.py | Sanitize EKM_EXTERNAL_ID to fake-external-key. |
| tests/_test_case.py, tests/_async_test_case.py | Propagate ekm_external_id through the preparer. |
| tests/test_key_client.py, tests/test_keys_async.py | Sync/async live tests for create_external_key round-trip. |
| tests/test_samples_keys.py, tests/test_samples_keys_async.py | Snippet tests for [START/END create_external_key]. |
| samples/external_key_operations.py, ..._async.py | New samples; use MANAGED_HSM_URL rather than the conventional VAULT_URL. |
| CHANGELOG.md | Move 4.12.0b2 to 2026-05-29 and document the new EKM surface. |
| assets.json | Bump recorded-test asset tag. |
56778a1 to
596db0e
Compare
596db0e to
db65fc6
Compare
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.
Description
ExternalKeymodel and the newKeyClient.create_external_keymethod for registering a Key Vault key whose material is held in an external HSM.KeyProperties.external_keyread-only property.All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines