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-keyvault-secrets-rust.md
1# Key Vault Secrets — Rust SDK Quick Reference23> Condensed from **azure-keyvault-secrets-rust**. Full patterns (versioning,4> update properties, tags, soft delete recovery)5> in the **azure-keyvault-secrets-rust** plugin skill if installed.67## Install8cargo add azure_security_keyvault_secrets azure_identity910## Quick Start11```rust12use azure_identity::DeveloperToolsCredential;13use azure_security_keyvault_secrets::SecretClient;14let credential = DeveloperToolsCredential::new(None)?;15let client = SecretClient::new("https://<vault>.vault.azure.net/", credential.clone(), None)?;16```1718## Best Practices19- Use Entra ID auth — `DeveloperToolsCredential` for dev, `ManagedIdentityCredential` for production20- Use `into_model()?` to deserialize responses21- Use `ResourceExt` trait for extracting names from IDs22- Handle soft delete — deleted secrets can be recovered within retention period23- Set content type — helps identify secret format24- Use tags for organizing and filtering secrets25- Version secrets — new values create new versions automatically2627## Non-Obvious Patterns28```rust29use azure_security_keyvault_secrets::models::SetSecretParameters;30let params = SetSecretParameters { value: Some("secret-value".into()), ..Default::default() };31client.set_secret("name", params.try_into()?, None).await?.into_model()?;32```33