Skills azure-security-keyvault-secrets-java
📦

azure-security-keyvault-secrets-java

Safe 🌐 Network access

Manage Azure Key Vault secrets with Java

Securely store and retrieve sensitive data like passwords and API keys using Azure Key Vault. This skill provides Java SDK patterns for secret management with proper authentication and rotation practices.

Supports: Claude Codex Code(CC)
🥉 72 Bronze
1

Download the skill ZIP

2

Upload in Claude

Go to Settings → Capabilities → Skills → Upload skill

3

Toggle on and start using

Test it

Using "azure-security-keyvault-secrets-java". Store a new API key in Key Vault

Expected outcome:

Secret created with name 'api-key' and ID 'https://vault-name.vault.azure.net/secrets/api-key'. The secret is enabled and ready for use.

Using "azure-security-keyvault-secrets-java". List all secrets in the vault

Expected outcome:

Found 5 secrets: db-connection-string (enabled, created 2024-01-15), api-key (enabled, expires 2025-01-01), jwt-secret (enabled), smtp-password (disabled), cert-password (enabled)

Using "azure-security-keyvault-secrets-java". Rotate the database password

Expected outcome:

Previous version of 'db-password' disabled. New version created with ID version 'a1b2c3d4'. Secret rotation completed successfully.

Security Audit

Safe
v1 • 2/25/2026

This skill provides documentation for the official Azure Key Vault Secrets Java SDK. All static analysis findings were evaluated as false positives. The detected patterns are XML declarations and Java code examples, not executable shell commands or malicious code. The skill is safe for publication.

1
Files scanned
362
Lines analyzed
1
findings
1
Total audits
Audited by: claude

Quality Score

38
Architecture
100
Maintainability
87
Content
31
Community
100
Security
100
Spec Compliance

What You Can Build

Enterprise Application Secrets

Store database connection strings, API keys, and service credentials securely instead of in configuration files.

Secret Rotation Automation

Implement automated credential rotation by creating new secret versions and deactivating old ones.

Multi-Environment Configuration

Load environment-specific secrets using tags and properties to support dev, staging, and production deployments.

Try These Prompts

Basic Secret Storage
Show me how to create an Azure Key Vault secret client and store a database password using the Java SDK.
Retrieve and Use Secret
How do I retrieve a secret from Azure Key Vault and use its value in my Java application? Include error handling.
Secret Rotation Implementation
Create a Java method that rotates a secret by disabling the old version and creating a new one with an updated value.
Batch Secret Loading
Build a ConfigLoader class that fetches multiple secrets from Azure Key Vault and returns them as a Map. Handle missing secrets gracefully.

Best Practices

  • Enable soft delete on Key Vault to protect against accidental deletion and allow recovery
  • Use tags to organize secrets by environment, service, and owner for easier management
  • Set expiration dates on secrets containing credentials to enforce regular rotation

Avoid

  • Hardcoding secret values in application code instead of retrieving from Key Vault
  • Logging or printing secret values which may expose them in application logs
  • Using the same Key Vault for all environments instead of separate vaults per environment

Frequently Asked Questions

How do I authenticate to Azure Key Vault from my Java application?
Use DefaultAzureCredential which automatically tries multiple authentication methods including managed identity, Azure CLI credentials, and environment variables. This is the recommended approach for production deployments.
Can I update the value of an existing secret?
No, secret values are immutable. To change a secret value, call setSecret() with the same name which creates a new version. You can update properties like enabled status and tags on existing versions.
What happens when I delete a secret?
If soft delete is enabled, the secret enters a deleted state and can be recovered for a retention period (7-90 days). After the retention period or if purge protection is disabled, you can permanently purge it.
How do I handle secrets that contain JSON or structured data?
Set the contentType property to 'application/json' when creating the secret. This helps identify the format. You can store any string value including JSON, XML, or connection strings.
What is the difference between sync and async clients?
The synchronous client blocks until operations complete, suitable for simple applications. The async client uses reactive programming with Project Reactor, better for high-throughput scenarios and non-blocking applications.
How do I access a specific version of a secret?
Use getSecret(name, version) with the specific version ID. You can list available versions using listPropertiesOfSecretVersions() to find the version identifier you need.