microsoft/skills

azure-keyvault-secrets-rust

在Rust中读取或管理Secret,并保留名称与版本

  • SKILL.md 已保存
  • 中文用法已整理
  • 安装与运行未实测
先判断是否解决你的问题

azure-keyvault-secrets-rust 是什么?

azure-keyvault-secrets-rust 使用官方azure_security_keyvault_secrets crate管理Key Vault中的密码、API key等Secret,覆盖读取、设置新版本、属性更新与分页列举。它管理的是Secret值和属性,不能与Key Vault加密Key或X.509证书操作混用。

中文说明由本站依据来源整理;英文原文保留在页面下方。

按客户端选择安装入口

怎么接入你的 Agent?

  1. 定位完整 Skill 目录

    打开本项目来源,核对 SKILL.md 及其引用的脚本和资料。

  2. 交给你正在用的 Agent

    在下面选择客户端,展开并复制安装指令,让 Agent 读取来源后选择安装方式。

  3. 确认识别,再做具体任务

    让 Agent 回报安装目录和识别到的名称 azure-keyvault-secrets-rust,然后按本页使用示例提供材料。

展开并复制给 Codex 的安装指令
发送给 Codex

安装并检查 azure-keyvault-secrets-rust

请在 Codex 的当前工作环境中安装并检查 azure-keyvault-secrets-rust 这个 Skill。

项目身份:microsoft/skills / azure-keyvault-secrets-rust
来源:https://github.com/microsoft/skills/blob/f03ec5392f7a0f3aca12af47477e92f1edf7b44c/.github/plugins/azure-sdk-rust/skills/azure-keyvault-secrets-rust/SKILL.md
已定位的源文件:.github/plugins/azure-sdk-rust/skills/azure-keyvault-secrets-rust/SKILL.md

1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。
准备输入,再按步骤执行

装好以后,具体怎么用?

准备哪些材料

  • 明确AZURE_KEYVAULT_URL、Secret名称及只读或管理需求,使用官方crate与相应身份。读取值按源文需Key Vault Secrets User等合适数据角色,管理操作需更高的Secret管理权限。

会得到什么

  • Rust client/操作代码、需要的身份角色和实际Secret元数据/版本状态;未执行部分保留说明。

实际使用顺序

  1. 用cargo添加官方secrets/identity等依赖,按本地DeveloperToolsCredential或云端ManagedIdentityCredential创建SecretClient;实际API按所装crate版本核对。
  2. 只读任务使用get_secret或list_secret_properties,分页按Pager逐item遍历,并用ResourceExt解析名称/版本。列表只包含属性,不能当作已读到所有Secret值。
  3. 确需设置值时用SetSecretParameters,改标签/content_type时用UpdateSecretPropertiesParameters,不混淆两种动作。模型初始化按source使用默认余项兼容新字段;记录操作版本,输出避免暴露Secret内容。
使用示例

从一个具体任务开始

本站根据源文件编写的使用示例,未在本站实际运行。示例中的文件由你提供。

安装并识别 Skill 后发送

复制一个具体任务

教学任务:用azure-keyvault-secrets-rust为我的Rust服务写一个只读Secret元数据列举程序,分页输出名称和版本,不打印值。先核对官方crate与DeveloperToolsCredential/ManagedIdentityCredential两种环境;权限不足时报告角色缺项,不改vault、不设置或删除Secret。
预期结果

预期得到分页与身份明确的Rust代码;本站未编译或读取Secret。

使用前先看这些限制

使用条件与边界

  • 安装crate不等于已具备vault数据角色;身份取token与Secret读取权限必须分开核对。
  • 源中打印Secret值的演示不适合作公开诊断输出,任务应只展示完成判断需要的元数据。
针对这个 Skill 的疑问

常见问题

列出了Secret就能读它的值吗?

不一定。源里list_secret_properties是属性分页,值读取用get_secret;权限和操作也需按实际vault核对,不能用列表成功替代值访问验证。

需要核对时再展开原文

来源原文与资料状态

源文件
已保存 SKILL.md,抓取于 2026-11-16T12:36:35.145Z
中文使用说明
已针对下方源文件版本整理用途、用法和常见问题
安装与任务测试
本站未执行安装或任务测试
来源复核
本页中文用法已对照保存版本的完整 SKILL.md 阅读整理
展开 SKILL.md 原文、章节与历史收录资料

.github/plugins/azure-sdk-rust/skills/azure-keyvault-secrets-rust/SKILL.md · 抓取时间 2026-11-16T12:36:35.145Z

以下保留源文件的 description、章节及摘录,供核对中文说明;完整文件通过上方链接打开。

抓取成功不代表已完成安装或任务测试。

来源 description(原文)

Azure Key Vault Secrets library for Rust. Store and retrieve secrets, passwords, and API keys. Triggers: "keyvault secrets rust", "SecretClient rust", "get secret rust", "set secret rust", "list secrets rust".

查看源文件章节 / Source sections
  • 原文:Azure Key Vault Secrets library for Rust
  • 安装 / Installation
  • 原文:Environment Variables
  • 原文:Authentication
  • 原文:Core Workflow
  • 原文:Set Secret
  • 原文:Update Secret Properties
  • 原文:Delete Secret
  • 原文:List Secrets (Pagination)
  • 原文:Error Handling
  • 原文:RBAC Roles
  • 原文:Best Practices
  • 原文:Reference Links
原文:Azure Key Vault Secrets library for Rust

Secure storage for passwords, API keys, and connection strings. Use this skill when: - An app needs to store or retrieve secrets from Azure Key Vault in Rust - You need to set, get, update, or delete secrets - You need to list secret properties with pagination - You need error handling for missing secrets > **IMPORTANT:** Only use the official `azure_security_keyvault_secrets` crate published by the [azure-sdk](https://crates.io/users/azure-sdk) crates.io user. Do NOT use unofficial or community crates. Official crates use underscores in names and none have version 0.21.0.

安装 / Installation

```sh cargo add azure_security_keyvault_secrets azure_identity tokio futures ``` > If your code uses `azure_core` types directly, add `azure_core` to `Cargo.toml`. If you only use `azure_security_keyvault_secrets` re-exports, direct `azure_core` dependency is optional.

原文:Environment Variables

```bash AZURE_KEYVAULT_URL=https://<vault-name>.vault.azure.net/ # Required for all operations ```

原文:Authentication

Rust Azure SDK code must not use `DefaultAzureCredential`. The Rust identity crate does not provide that type. ```rust use azure_identity::DeveloperToolsCredential; use azure_security_keyvault_secrets::SecretClient; #[tokio::main] async fn main() -> Result<(), Box<dyn std::error::Error>> { // Local dev: DeveloperToolsCredential. Production: use ManagedIdentityCredential. let credential = DeveloperToolsCredential::new(None)?; let client = SecretClient::new( "https://<vault-name>.vault.azure.net/", credential.clone(), None, )?; let secret = client .get_secret("secret-name", None) .await? .into_model()?; println!("Secret: {:?}", secret.value); Ok(()) } ``` Prefer the crate README/examples when checking whether pagers yield items directly and how `ResourceExt` is used in public examples.

原文:Set Secret

```rust use azure_security_keyvault_secrets::{models::SetSecretParameters, ResourceExt}; let params = SetSecretParameters { value: Some("secret-value".into()), ..Default::default() }; let secret = client .set_secret("secret-name", params.try_into()?, None) .await? .into_model()?; println!( "Name: {:?}, Version: {:?}", secret.resource_id()?.name, secret.resource_id()?.version ); ```

原文:Update Secret Properties

```rust use azure_security_keyvault_secrets::models::UpdateSecretPropertiesParameters; use std::collections::HashMap; #[allow(clippy::needless_update)] let params = UpdateSecretPropertiesParameters { content_type: Some("text/plain".into()), tags: Some(HashMap::from_iter(vec![( "env".into(), "prod".into(), )])), ..Default::default() }; client .update_secret_properties("secret-name", params.try_into()?, None) .await? .into_model()?; ```

文件 SHA256:d246f8bf17b28cca1e9d06548bb64e71b0945ea5aadfdfb3e1327e7bff30c7a2

仓库许可证记录:MIT;skill-declaration-captured-not-interpreted,查看来源。

SKILL.md原文description · 2026-11-16T12:36:35.145Z

Azure Key Vault Secrets library for Rust. Store and retrieve secrets, passwords, and API keys. Triggers: "keyvault secrets rust", "SecretClient rust", "get secret rust", "set secret rust", "list secrets rust".

查看历史简介来源

历史收录数据

来源仓库microsoft/skills
Skill源路径.github/plugins/azure-sdk-rust/skills/azure-keyvault-secrets-rust/SKILL.md

安装前请让使用的Agent先读取这个SKILL.md及其所在目录,确认依赖和所需权限。此页不生成未经来源验证的安装命令。

返回 Skills 目录,按任务继续筛选 · MCP与Skills教程与资源