Skip to content

Commit db65fc6

Browse files
author
Nicola Camillucci
committed
Updated READMEs
1 parent 534dd30 commit db65fc6

3 files changed

Lines changed: 29 additions & 1 deletion

File tree

sdk/keyvault/azure-keyvault-keys/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
### Features Added
66

77
- Added the `ExternalKey` model and the new `KeyClient.create_external_key` method
8-
for registering a Key Vault key whose material is held in an external HSM.
8+
for registering a Key Vault key whose material is held in an external HSM [#47200](https://github.com/Azure/azure-sdk-for-python/pull/47200).
99
- Added the `KeyProperties.external_key` read-only property.
1010

1111
## 4.12.0b1 (2026-05-26)

sdk/keyvault/azure-keyvault-keys/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ This section contains code snippets covering common tasks:
8686
* [Update an existing key](#update-an-existing-key)
8787
* [Delete a key](#delete-a-key)
8888
* [Configure automatic key rotation](#configure-automatic-key-rotation)
89+
* [Register external keys](#register-external-keys-managed-hsm-only)
8990
* [List keys](#list-keys)
9091
* [Perform cryptographic operations](#cryptographic-operations)
9192
* [Async API](#async-api)
@@ -204,6 +205,29 @@ print(f"Rotated the key on-demand; new version is {rotated_key.properties.versio
204205

205206
<!-- END SNIPPET -->
206207

208+
### Register external keys (Managed HSM only)
209+
[create_external_key](https://aka.ms/azsdk/python/keyvault-keys/docs#azure.keyvault.keys.KeyClient.create_external_key)
210+
registers an external key with a Managed HSM that is configured to use External Key Management (EKM). The external HSM
211+
owns the key material; the Managed HSM stores only a reference to the key.
212+
213+
> **NOTE:** External keys are only supported on Managed HSM, not regular Key Vault. The Managed HSM must be configured
214+
> with an external HSM source.
215+
216+
```python
217+
from azure.identity import DefaultAzureCredential
218+
from azure.keyvault.keys import ExternalKey, KeyClient
219+
220+
credential = DefaultAzureCredential()
221+
222+
key_client = KeyClient(vault_url="https://my-managed-hsm.managedhsm.azure.net/", credential=credential)
223+
224+
external_key = ExternalKey(id="external-key-reference-id")
225+
key = key_client.create_external_key("external-key-name", external_key=external_key)
226+
227+
print(key.name)
228+
print(key.properties.external_key.id)
229+
```
230+
207231
### List keys
208232
[list_properties_of_keys](https://aka.ms/azsdk/python/keyvault-keys/docs#azure.keyvault.keys.KeyClient.list_properties_of_keys)
209233
lists the properties of all of the keys in the client's vault.

sdk/keyvault/azure-keyvault-keys/samples/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,16 @@ pip install azure-keyvault-keys azure-identity
3636
| [backup_restore_operations.py][backup_operations_sample] ([async version][backup_operations_async_sample]) | back up and recover keys |
3737
| [recover_purge_operations.py][recover_purge_sample] ([async version][recover_purge_async_sample]) | recover and purge keys |
3838
| [key_rotation.py][key_rotation_sample] ([async version][key_rotation_async_sample]) | create/update key rotation policies and rotate keys on-demand |
39+
| [external_key_operations.py][external_key_sample] ([async version][external_key_async_sample]) | register and manage external keys with Managed HSM (EKM) |
3940
| [send_request.py][send_request_sample] | use the `send_request` client method |
4041

4142

4243
[backup_operations_sample]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/keyvault/azure-keyvault-keys/samples/backup_restore_operations.py
4344
[backup_operations_async_sample]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/keyvault/azure-keyvault-keys/samples/backup_restore_operations_async.py
4445

46+
[external_key_sample]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/keyvault/azure-keyvault-keys/samples/external_key_operations.py
47+
[external_key_async_sample]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/keyvault/azure-keyvault-keys/samples/external_key_operations_async.py
48+
4549
[hello_world_sample]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/keyvault/azure-keyvault-keys/samples/hello_world.py
4650
[hello_world_async_sample]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/keyvault/azure-keyvault-keys/samples/hello_world_async.py
4751

0 commit comments

Comments
 (0)