Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Audit Azure resources for compliance, security best practices, and Key Vault expiration monitoring
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/sdk/azure-security-keyvault-keys-dotnet.md
1# Key Vault Keys — .NET SDK Quick Reference23> Condensed from **azure-security-keyvault-keys-dotnet**. Full patterns4> (crypto operations, key rotation, backup/restore, HSM, KeyResolver)5> in the **azure-security-keyvault-keys-dotnet** plugin skill if installed.67## Install8dotnet add package Azure.Security.KeyVault.Keys9dotnet add package Azure.Identity1011## Quick Start12```csharp13using Azure.Security.KeyVault.Keys;14using Azure.Identity;15var client = new KeyClient(new Uri("https://<vault>.vault.azure.net"), new DefaultAzureCredential());16```1718## Best Practices19- Use DefaultAzureCredential for **local development only**. In production, use ManagedIdentityCredential — see [auth-best-practices.md](../auth-best-practices.md)20- Enable soft-delete — protect against accidental deletion21- Use HSM-backed keys — set `HardwareProtected = true` for sensitive keys22- Implement key rotation — use automatic rotation policies23- Limit key operations — only enable required KeyOperations24- Set expiration dates — always set ExpiresOn for keys25- Use specific versions — pin to versions in production26- Cache CryptographyClient — reuse for multiple operations27