[Key Vault] Add External Key Manager (EKM) support for Managed HSM (Preview)#33650
Closed
notyashhh wants to merge 3 commits into
Closed
[Key Vault] Add External Key Manager (EKM) support for Managed HSM (Preview)#33650notyashhh wants to merge 3 commits into
notyashhh wants to merge 3 commits into
Conversation
…to public SDKs - Mark 'keyvault ekm-connection' (+ certificate) command groups and --external-key-id as is_preview=True. - Use public azure-keyvault-keys create_external_key() and public ExternalKey import. - Enforce external-key-id <=64 chars per public SDK contract; add boundary test. - Bump deps to azure-keyvault-keys==4.12.0b2 and azure-keyvault-administration==4.8.0b1 (setup.py + 3 requirements). - Remove private-preview artifacts (bundled SDK wheels, temp cert). - Add --server-cn short alias to satisfy option-length linter.
|
Validation for Azure CLI Full Test Starting...
Thanks for your contribution! |
|
Hi @notyashhh, |
|
Validation for Breaking Change Starting...
Thanks for your contribution! |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds public-preview Managed HSM External Key Manager (EKM) support to az keyvault, including new EKM connection management commands and the ability to create EKM-backed external keys, backed by newer (public preview) azure-keyvault-* SDKs.
Changes:
- Bumps Key Vault data-plane SDK dependencies to public-preview versions needed for EKM/external key APIs.
- Adds new preview command group
az keyvault ekm-connection(create/update/show/check/delete +certificate show) backed by a new data-plane EKM client. - Extends
az keyvault key createwith--external-key-idto create EKM-backed external keys, plus validation/output shaping and unit tests.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/azure-cli/setup.py | Pins Key Vault SDK deps to preview versions required for EKM/external key APIs. |
| src/azure-cli/requirements.py3.windows.txt | Mirrors the preview Key Vault SDK pins for Windows packaging. |
| src/azure-cli/requirements.py3.Linux.txt | Mirrors the preview Key Vault SDK pins for Linux packaging. |
| src/azure-cli/requirements.py3.Darwin.txt | Mirrors the preview Key Vault SDK pins for macOS packaging. |
| src/azure-cli/azure/cli/command_modules/keyvault/tests/latest/test_keyvault_commands.py | Adds offline unit tests for external key id validation, EKM host/path validation, and certificate serialization behavior. |
| src/azure-cli/azure/cli/command_modules/keyvault/custom.py | Implements external-key creation path plus EKM connection/certificate operations. |
| src/azure-cli/azure/cli/command_modules/keyvault/commands.py | Registers new preview keyvault ekm-connection command groups and wires validators/client factory. |
| src/azure-cli/azure/cli/command_modules/keyvault/_validators.py | Adds --external-key-id validation and new EKM connection argument validation helpers. |
| src/azure-cli/azure/cli/command_modules/keyvault/_transformers.py | Fixes crypto output hex fields to be strings and surfaces externalKeyId when present. |
| src/azure-cli/azure/cli/command_modules/keyvault/_params.py | Adds --external-key-id and defines argument surface for new ekm-connection commands. |
| src/azure-cli/azure/cli/command_modules/keyvault/_help.py | Adds help entries for the new ekm-connection command group. |
| src/azure-cli/azure/cli/command_modules/keyvault/_client_factory.py | Adds data-plane KeyVaultEkmClient factory for the new commands. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+750
to
+754
| def validate_external_key_id(ns): | ||
| external_key_id = getattr(ns, 'external_key_id', None) | ||
| if not external_key_id: | ||
| return | ||
| if len(external_key_id) > 64: |
Member
Author
|
STALE. New PR: #33651 |
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.
Related command
az keyvault ekm-connection(create/update/show/check/delete +certificate show)az keyvault key create --external-key-idDescription
Adds public-preview support for Managed HSM External Key Manager (EKM) to
az keyvault.What's added:
az keyvault ekm-connectionto wire a Managed HSM to an external keymanager proxy:
create,update,show,check,delete, andcertificate show.--external-key-idflag onaz keyvault key createto create EKM-backed external keys.All new commands and the
--external-key-idargument are marked preview (is_preview=True).This builds on the private-preview implementation and moves it to the public preview SDKs:
azure-keyvault-keys==4.12.0b2— uses the newcreate_external_key()API and the publicExternalKeymodel.azure-keyvault-administration==4.8.0b1—KeyVaultEkmClient/KeyVaultEkmConnection.Both SDKs are published on PyPI and require Python >=3.10, which matches the CLI's floor
(
python_requires>=3.10), so there is no dependency-resolution impact on CI.Notes:
dedicated
create_external_key()path and omits those attributes.--external-key-idis validated to the public SDK contract ([A-Za-z0-9-], max 64 chars).internal 1P drop.
Testing Guide
Unit (offline):
Live smoke (Managed HSM required):
History Notes
[Key Vault]
az keyvault ekm-connection: Add command group to manage External Key Manager (EKM) connections for Managed HSM (Preview).[Key Vault]
az keyvault key create: Add--external-key-idto create EKM-backed external keys on Managed HSM (Preview).