Azure Key Vault SDK for Python
Gives Python coding agents practical guidance for securely managing Azure Key Vault secrets, keys, and certificates.
The skill recommends DefaultAzureCredential, Entra auditing, managed identity, RBAC, soft delete, and recovery, while discouraging connection strings and API keys, which supports a relatively strong baseline. Points are deducted because examples print secret values, deletion and permanent purge lack user confirmation, preflight authorization checks, or safeguards, and sensitive logging, data flow, and dependency-security risks are not disclosed.
The main paths cover installation, sync and async clients, lifecycle management, error handling, and cleanup, with examples for common exceptions and 403 feedback. Points are deducted because the document says local DefaultAzureCredential works as-is while the core SecretClient example uses require_envvar=True; examples rely on placeholders, lack version constraints and execution evidence, and leave several edge and failure modes unexplained. Static calibration caps this below 10.
Triggers, audience, and primary scenarios are reasonably clear, covering secrets, keys, certificates, cryptographic operations, and async usage, with references separating secondary scenarios. Points are deducted because non-fit boundaries, environment prerequisites, permission-model differences, and version boundaries are not explicit; there is no Chinese-language guidance or mainland-China reachability/region analysis.
The skill uses progressive sections for installation, authentication, domain examples, error handling, best practices, and references. It includes MIT licensing, Microsoft authorship, version 1.0.0, and package metadata, while repository README and CI provide some governance evidence. Points are deducted because the skill lacks a changelog, explicit maintainer and update path, FAQ, dependency versions, and a clear limitations section; references still require users to verify current APIs themselves.
The material can directly support common Key Vault Python SDK tasks, including secrets, keys, certificates, cryptography, deletion and recovery, and async clients. Points are deducted because URLs, names, permissions, and authentication environment must be supplied by the user, no verified end-to-end output is shown, and secret printing, purge examples, and possible API-version uncertainty can require substantial review. Static calibration caps this below 7.
The files provide concrete package names, classes, environment variables, code samples, reference indexes, and repository-level test/CI evidence, giving a modest audit trail. Points are deducted because the supplied tests are not skill-specific execution evidence, and there are no shown Key Vault path tests, pinned dependencies, real outputs, or independent corroboration; static reading cannot establish that the snippets run. Static calibration caps this below 5.
- Do not print secret.value, certificate private keys, or plaintext in production logs; confirm logging and redaction policies first.
- Deletion and purge change external state; confirm the target, permissions, retention policy, and recovery plan before execution, and do not treat purge as routine cleanup.
- Verify current Azure SDK APIs, credential-chain configuration, and RBAC permissions; the SecretClient example's require_envvar=True conflicts with the statement that local use works as-is.
- Validate Azure Key Vault reachability and service support for mainland-China deployments based on region, network egress, and compliance requirements.
What it does & when to use it
This skill is part of Microsoft’s Agent Skills collection and focuses specifically on the Azure Key Vault SDK for Python. It covers installation, credential selection, client lifecycle, and common operations for secrets, cryptographic keys, and certificates. It includes both synchronous and asynchronous examples, plus error handling and production-oriented practices. It fits teams building Azure-hosted Python applications that need centralized secret storage or key-backed cryptographic operations.
Guides installation of azure-keyvault-secrets, azure-keyvault-keys, azure-keyvault-certificates, and azure-identity; configures AZURE_KEYVAULT_URL and the optional AZURE_TOKEN_CREDENTIALS setting; uses SecretClient to create, retrieve, list, delete, recover, and purge secrets; uses KeyClient to create, retrieve, list, and delete RSA or EC keys; uses CryptographyClient for encryption, decryption, signing, and verification; uses CertificateClient to create, retrieve, list, and delete certificates; shows synchronous and asynchronous client patterns; and handles ResourceNotFoundError and HttpResponseError.
- A Python backend developer needs to store database passwords or other application secrets in Azure Key Vault.
- An Azure application needs to create and manage RSA or EC keys and perform encryption, decryption, signing, or verification.
- A platform team needs to manage self-signed certificates and retrieve certificate private-key material stored as a secret.
- A developer wants one DefaultAzureCredential pattern to work across local development and Azure-hosted environments.
- A high-throughput Python service needs asynchronous Key Vault clients with deterministic credential and transport cleanup.
Pros & cons
- Covers the three central Key Vault areas: secrets, keys, and certificates.
- Includes synchronous and asynchronous Python examples, including cryptographic operations.
- Provides explicit guidance on DefaultAzureCredential, managed identity, RBAC, soft delete, and version-based rotation.
- Shows handling for missing resources and 403 authorization failures.
- Its scope is limited to the Azure Key Vault Python SDK, not other languages or Azure services.
- The source provides no independent test results or test suite specifically for this skill.
- Use requires an Azure Key Vault, valid credentials, permissions, and network access.
- The source does not document pricing, quotas, or resource-provisioning steps.
How to install
Install the collection with npx skills add microsoft/skills, then select this skill in the interactive wizard. The collection is installed into the selected agent directory, such as .github/skills/ for GitHub Copilot. Install the required Python packages as needed: pip install azure-keyvault-secrets azure-identity, pip install azure-keyvault-keys azure-identity, pip install azure-keyvault-certificates azure-identity, or all packages together. The source does not document exact installation paths for other agents.
How to use
With the skill loaded, ask an agent for a concrete task such as “Use Python SecretClient to read database-password from Azure Key Vault” or “Use CryptographyClient to encrypt data with RSA-OAEP.” Set AZURE_KEYVAULT_URL=https://<vault-name>.vault.azure.net/; when using DefaultAzureCredential in production, also set AZURE_TOKEN_CREDENTIALS=prod or a specific credential value. Use with for synchronous clients, and async with for asynchronous clients and azure.identity.aio credentials.