Azure Key Vault Keys Client Library Python Samples


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.


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.


File Description (async version) create/get/update/delete keys (async version) basic list operations for keys (async version) back up and recover keys (async version) recover and purge keys (async version) create/update key rotation policies and rotate keys on-demand use the send_request client method