Azure Key Vault Keys Client Library Python Samples
Prerequisites
You must have an Azure subscription and an Azure Key Vault to run these samples. You can create a key vault with the Azure CLI.
You can also run these samples with a Key Vault Managed HSM. If you need to create a Managed HSM, you can do so using the Azure CLI by following the steps in this document.
Setup
To run these samples, first install the Key Vault Keys and Azure Identity libraries:
pip install azure-keyvault-keys azure-identity
Azure Identity is used for authenticating Key Vault clients. These samples use the DefaultAzureCredential, but any credential from the library can be used with Key Vault clients.
Contents
File | Description |
---|---|
hello_world.py (async version) | create/get/update/delete keys |
list_operations.py (async version) | basic list operations for keys |
backup_restore_operations.py (async version) | back up and recover keys |
recover_purge_operations.py (async version) | recover and purge keys |
key_rotation.py (async version) | create/update key rotation policies and rotate keys on-demand |
send_request.py | use the send_request client method |