Azure Key Vault SDK for Python
Manage Azure secrets, keys, and certificates with Python SDK
Securely store and access sensitive data using Azure Key Vault. This skill enables developers to implement enterprise-grade secret management with minimal setup.
Download the skill ZIP
Upload in Claude
Go to Settings → Capabilities → Skills → Upload skill
Toggle on and start using
Test it
Using "Azure Key Vault SDK for Python". Retrieve a secret named 'api-key' from Key Vault
Expected outcome:
Successfully retrieved secret 'api-key'. Value is masked for security. Version: v1, Created: 2024-01-15, Expires: 2025-01-15. Use secret.value property to access the actual value in your code.
Using "Azure Key Vault SDK for Python". Create an RSA key with 2048-bit size named 'signing-key'
Expected outcome:
Key 'signing-key' created successfully. Key type: RSA, Size: 2048 bits, Key ID: https://myvault.vault.azure.net/keys/signing-key/abc123. Use CryptographyClient with this key for sign/verify operations.
Security Audit
SafeThis skill contains documentation-only content for Azure Key Vault SDK for Python. Static analysis scanned 0 files with 0 lines of executable code, resulting in a risk score of 0/100. The SKILL.md file contains standard code examples for Azure SDK usage with no security concerns. Safe for publication.
Quality Score
What You Can Build
Database Credential Management
Store and rotate database passwords securely without hardcoding in application code. Applications retrieve credentials at runtime using managed identity.
API Key and Token Storage
Centralize storage for third-party API keys, tokens, and connection strings with automatic rotation and audit logging.
Document Encryption at Rest
Use Key Vault cryptographic keys to encrypt sensitive documents and data before storage, ensuring only authorized services can decrypt.
Try These Prompts
Help me retrieve a secret named 'database-connection-string' from my Azure Key Vault using Python. My vault URL is https://myvault.vault.azure.net/
Show me how to create a new secret with a value and then retrieve a specific previous version using the Azure Key Vault Python SDK.
I need to encrypt a file using RSA encryption with a key stored in Azure Key Vault. Write Python code using CryptographyClient to encrypt the file and then decrypt it later.
Create an async Python function that retrieves multiple secrets from Key Vault, handles ResourceNotFoundError and HttpResponseError appropriately, and returns a dictionary of secret names to values.
Best Practices
- Use DefaultAzureCredential for authentication which supports multiple credential types including managed identity, environment credentials, and Azure CLI
- Enable soft-delete on Key Vault to recover accidentally deleted secrets, keys, and certificates within the retention period
- Implement secret rotation by creating new versions instead of overwriting, and update application references to use the latest version
Avoid
- Never hardcode Key Vault URLs or secrets directly in application code - use environment variables or configuration
- Avoid storing large amounts of data in secrets - Key Vault is designed for small sensitive values like passwords and connection strings
- Do not skip error handling for 403 Forbidden responses - this usually indicates missing RBAC permissions that need to be addressed