New to Claude Skills? Learn how to install them →

sickn33 on GitHub

Azure Key Vault Secrets SDK

Free

Securely manage secrets in Rust applications.

Get this skill

Free · Opens the source repo

What Azure Key Vault Secrets SDK does

The Azure Key Vault Secrets SDK for Rust provides a robust client library designed for securely storing and retrieving secrets, such as passwords and API keys. This SDK is particularly useful for developers who need to manage sensitive information in their applications while adhering to security best practices. By integrating with Azure Key Vault, it offers a reliable way to handle secrets without hardcoding them into your application code.

Installation is straightforward, requiring the addition of two Rust crates: azure_security_keyvault_secrets and azure_identity. Once installed, you can authenticate using DeveloperToolsCredential for development purposes, or switch to ManagedIdentityCredential for production environments. This flexibility ensures that your application can securely access secrets while minimizing the risk of exposure.

The SDK supports core operations such as getting, setting, updating, and deleting secrets. For instance, you can easily retrieve a secret's value or update its properties with minimal code. The SDK also allows for listing secrets and retrieving specific versions, which is essential for managing secret lifecycle and ensuring that your application can always access the correct data. Additionally, the use of tags and content types helps in organizing secrets efficiently.

Developers looking to implement secure secret management in their Rust applications will find this SDK invaluable. It not only simplifies the process of interacting with Azure Key Vault but also encourages best practices in handling sensitive information. Whether you are building a new application or enhancing an existing one, the Azure Key Vault Secrets SDK provides the tools necessary to manage secrets securely and effectively.

When to use it

Use this SDK when developing Rust applications that require secure handling of secrets, passwords, or API keys.

When not to use it

Avoid using this SDK for non-Rust applications or when secret management is not a requirement.

What you can build with it

Storing API Keys

Use the SDK to securely store API keys required for third-party services, ensuring they are not hardcoded in your application.

Managing Passwords

Implement the SDK to manage user passwords securely, allowing for easy updates and retrievals without compromising security.

Versioning Secrets

Utilize the SDK's versioning capabilities to maintain different versions of secrets, facilitating smooth updates and rollbacks.

How to install Azure Key Vault Secrets SDK

View source

1. Install with the skills CLI

npx skills add sickn33/agentic-awesome-skills/azure-keyvault-secrets-rust --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by sickn33

Azure Key Vault Secrets SDK for Rust

Client library for Azure Key Vault Secrets — secure storage for passwords, API keys, and other secrets.

Installation

cargo add azure_security_keyvault_secrets azure_identity

Environment Variables

AZURE_KEYVAULT_URL=https://<vault-name>.vault.azure.net/

Authentication

use azure_identity::DeveloperToolsCredential;
use azure_security_keyvault_secrets::SecretClient;

let credential = DeveloperToolsCredential::new(None)?;
let client = SecretClient::new(
    "https://<vault-name>.vault.azure.net/",
    credential.clone(),
    None,
)?;

Core Operations

Get Secret

let secret = client
    .get_secret("secret-name", None)
    .await?
    .into_model()?;

println!("Secret value: {:?}", secret.value);

Set Secret

use azure_security_keyvault_secrets::models::SetSecretParameters;

let params = SetSecretParameters {
    value: Some("secret-value".into()),
    ..Default::default()
};

let secret = client
    .set_secret("secret-name", params.try_into()?, None)
    .await?
    .into_model()?;

Update Secret Properties

use azure_security_keyvault_secrets::models::UpdateSecretPropertiesParameters;
use std::collections::HashMap;

let params = UpdateSecretPropertiesParameters {
    content_type: Some("text/plain".into()),
    tags: Some(HashMap::from([("env".into(), "prod".into())])),
    ..Default::default()
};

client
    .update_secret_properties("secret-name", params.try_into()?, None)
    .await?;

Delete Secret

client.delete_secret("secret-name", None).await?;

List Secrets

use azure_security_keyvault_secrets::ResourceExt;
use futures::TryStreamExt;

let mut pager = client.list_secret_properties(None)?.into_stream();
while let Some(secret) = pager.try_next().await? {
    let name = secret.resource_id()?.name;
    println!("Secret: {}", name);
}

Get Specific Version

use azure_security_keyvault_secrets::models::SecretClientGetSecretOptions;

let options = SecretClientGetSecretOptions {
    secret_version: Some("version-id".into()),
    ..Default::default()
};

let secret = client
    .get_secret("secret-name", Some(options))
    .await?
    .into_model()?;

Best Practices

  1. Use Entra ID authDeveloperToolsCredential for dev, ManagedIdentityCredential for production
  2. Use into_model()? — to deserialize responses
  3. Use ResourceExt trait — for extracting names from IDs
  4. Handle soft delete — deleted secrets can be recovered within retention period
  5. Set content type — helps identify secret format
  6. Use tags — for organizing and filtering secrets
  7. Version secrets — new values create new versions automatically

RBAC Permissions

Assign these Key Vault roles:

  • Key Vault Secrets User — get and list
  • Key Vault Secrets Officer — full CRUD

Reference Links

ResourceLink
API Referencehttps://docs.rs/azure_security_keyvault_secrets
Source Codehttps://github.com/Azure/azure-sdk-for-rust/tree/main/sdk/keyvault/azure_security_keyvault_secrets
crates.iohttps://crates.io/crates/azure_security_keyvault_secrets

When to Use

This skill is applicable to execute the workflow or actions described in the overview.

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.

Frequently asked questions about Azure Key Vault Secrets SDK

Similar skills