Skills Azure.Security.KeyVault.Keys (.NET)
🔐

Azure.Security.KeyVault.Keys (.NET)

Safe

Generate Azure Key Vault key code

Developers struggle with Azure Key Vault key management APIs and secure cryptographic practices. This skill provides ready-to-use .NET code snippets, best practices, and implementation guidance for storing, retrieving, and managing cryptographic keys in Azure Key Vault.

Supports: Claude Codex Code(CC)
⚠️ 67 Poor
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.Keys (.NET)". Create a new RSA key in Azure Key Vault with 2048-bit size

Expected outcome:

```csharp
using Azure.Identity;
using Azure.Security.KeyVault.Keys;

var keyClient = new KeyClient(
new Uri("https://myvault.vault.azure.net/"),
new DefaultAzureCredential());

var createKeyOptions = new CreateRsaKeyOptions("my-rsa-key")
{
KeySize = 2048,
ExpiresOn = DateTimeOffset.Now.AddYears(1)
};

KeyVaultKey key = await keyClient.CreateRsaKeyAsync(createKeyOptions);
Console.WriteLine($"Created key: {key.Name}");
```

Using "Azure.Security.KeyVault.Keys (.NET)". Set up automatic key rotation

Expected outcome:

```csharp
var rotationPolicy = new KeyRotationPolicy
{
LifetimeActions =
{
new KeyLifetimeAction
{
Action = KeyRotationAction.Notify,
TimeBeforeExpiry = TimeSpan.FromDays(30)
}
}
};

await keyClient.UpdateKeyRotationPolicyAsync("my-key", rotationPolicy);
```

Security Audit

Safe
v1 • 2/25/2026

Prompt-only skill with no executable code. Static analysis scanned 0 files and detected 0 potential security issues. Risk score: 0/100. This skill provides guidance and code generation templates for Azure Key Vault key operations using the official Azure SDK for .NET.

0
Files scanned
0
Lines analyzed
0
findings
1
Total audits
No security issues found
Audited by: claude

Quality Score

38
Architecture
100
Maintainability
85
Content
22
Community
100
Security
74
Spec Compliance

What You Can Build

Generate key creation code

Create new cryptographic keys in Azure Key Vault with custom key properties

Implement key rotation

Set up automated key rotation with rotation policies and notifications

Backup and restore keys

Export and import keys securely for disaster recovery scenarios

Try These Prompts

Create a new key
Show me how to create a new RSA key in Azure Key Vault using the Azure SDK for .NET. Include code for setting key size and expiration.
Retrieve and use a key
How do I retrieve an existing key from Azure Key Vault and use it for encryption in my .NET application?
Set up key rotation
Configure automatic key rotation for a key in Azure Key Vault. Show how to set rotation policy and lifetime actions.
Backup and restore key
Generate code to backup a key to a secure location and restore it when needed. Include error handling.

Best Practices

  • Use Azure Identity with Managed Identity in production environments to avoid storing credentials
  • Set appropriate expiration times for keys and implement regular rotation policies
  • Use separate Key Vaults for different environments (dev, staging, production)

Avoid

  • Storing Key Vault URLs or credential information in source code
  • Granting excessive permissions to key operations beyond what is needed
  • Skipping error handling when interacting with Key Vault operations

Frequently Asked Questions

What authentication methods does this skill support?
The skill demonstrates Azure Identity with DefaultAzureCredential, Managed Identity, and service principal authentication.
Can I use this skill with hardware security modules?
Yes, Azure Key Vault supports HSM-protected keys. The skill includes examples for creating HSM keys.
How do I handle key permissions in my application?
Configure Key Vault access policies or use Azure RBAC to grant specific permissions to your application identity.
What key types are supported?
Azure Key Vault supports RSA, EC (Elliptic Curve), and AES symmetric keys. The skill covers RSA and EC keys.
Can I import existing keys?
Yes, use the ImportKey method to bring existing keys into Azure Key Vault. The skill provides import examples.
How does key versioning work?
Each key operation can create a new version. The key client retrieves the latest version by default, or you can specify a version.

Developer Details

File structure

📄 SKILL.md