azure-identity-rust
하는 일
Rust로 작성된 프로그램이 Microsoft Azure 서비스에 안전하게 연결하도록 돕는 도구입니다. 프로그램이 자신을 식별하고 자원에 접근할 권한이 있음을 증명하는 방식을 관리합니다.
사용하는 경우
- ✓로컬에서 Azure에 접근해야 하는 Rust 프로그램을 개발할 때.
- ✓프로그램이 이미 Azure 서비스(가상 머신이나 웹 앱 등)에서 실행 중일 때.
- ✓프로그램이 비밀 정보나 인증서가 있는 ‘service principal’을 써서 Azure에 접근하도록 설정할 때.
스킬 링크
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/azure-identity-rust/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“명령줄 자격 증명을 사용해 Rust 프로그램이 Azure에 연결하려면 어떻게 하나요?”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
프로그램의 신원을 증명하는 여러 방법을 시도합니다. 컴퓨터에 설치된 개발자 도구부터 시작하고, 없으면 Azure에서 직접 설정한 신원이나 제공된 비밀 정보를 사용할 수 있습니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Azure Identity SDK for Rust
Authentication library for Azure SDK clients using Microsoft Entra ID (formerly Azure AD).
The examples below require a reviewed compatible crate set and replacement of every resource placeholder. Do not use production data for demonstration writes.
Installation
cargo add azure_identity@=1.0.0 azure_core@=1.1.0
Environment Variables
# Service Principal (for production/CI)
export AZURE_TENANT_ID="<your-tenant-id>"
export AZURE_CLIENT_ID="<your-client-id>"
: "${AZURE_CLIENT_SECRET:?Inject through the approved host or CI secret manager}"
export AZURE_CLIENT_SECRET
# User-assigned Managed Identity (optional)
export AZURE_CLIENT_ID="<managed-identity-client-id>"
DeveloperToolsCredential
The recommended credential for local development. Tries developer tools in order (Azure CLI, Azure Developer CLI):
use azure_identity::DeveloperToolsCredential;
use azure_security_keyvault_secrets::SecretClient;
let credential = DeveloperToolsCredential::new(None)?;
let client = SecretClient::new(
"https://my-vault.vault.azure.net/",
credential.clone(),
None,
)?;
Credential Chain Order
| Order | Credential | Environment |
|---|---|---|
| 1 | AzureCliCredential | az login |
| 2 | AzureDeveloperCliCredential | azd auth login |
Credential Types
| Credential | Usage |
|---|---|
DeveloperToolsCredential |
Local development - tries CLI tools |
ManagedIdentityCredential |
Azure VMs, App Service, Functions, AKS |
WorkloadIdentityCredential |
Kubernetes workload identity |
ClientSecretCredential |
Service principal with secret |
ClientCertificateCredential |
Service principal with certificate |
AzureCliCredential |
Direct Azure CLI auth |
AzureDeveloperCliCredential |
Direct azd CLI auth |
AzurePipelinesCredential |
Azure Pipelines service connection |
ClientAssertionCredential |
Custom assertions (federated identity) |
ManagedIdentityCredential
For Azure-hosted resources:
use azure_identity::{ManagedIdentityCredential, ManagedIdentityCredentialOptions, UserAssignedId};
// System-assigned managed identity
let credential = ManagedIdentityCredential::new(None)?;
// User-assigned managed identity
let options = ManagedIdentityCredentialOptions {
user_assigned_id: Some(UserAssignedId::ClientId("<user-assigned-mi-client-id>".into())),
..Default::default()
};
let credential = ManagedIdentityCredential::new(Some(options))?;
ClientSecretCredential
For service principal with secret:
use azure_identity::ClientSecretCredential;
let credential = ClientSecretCredential::new(
"<tenant-id>".into(),
"<client-id>".into(),
"<client-secret>".into(),
None,
)?;
Best Practices
- Use
DeveloperToolsCredentialfor local dev — automatically picks up Azure CLI - Use
ManagedIdentityCredentialin production — no secrets to manage - Clone credentials — credentials are
Arc-wrapped and cheap to clone - Reuse credential instances — same credential can be used with multiple clients
- Provide the async runtime — add Tokio with the features required by your application; do not assume a crate-specific
tokiofeature exists
The reviewed example set uses azure_identity 1.0.0 and compatible Azure core/credential crates. Record and commit Cargo.lock; source/API review is not a compiler or live-service test.
Reference Links
| Resource | Link |
|---|---|
| API Reference | https://docs.rs/azure_identity |
| Source Code | https://github.com/Azure/azure-sdk-for-rust/tree/main/sdk/identity/azure_identity |
| crates.io | https://crates.io/crates/azure_identity |
When to Use
Use when choosing or configuring Entra ID credentials for Rust Azure SDK clients: local developer tools, managed/workload identity or a reviewed service principal.
Limitations
- Examples are fragments inside async application code, with compatible pinned Azure crates and the required Tokio/Serde/Futures dependencies; verify the selected version’s API before use. They were reviewed against official source/reference, not compiled or run against a cloud account here.
…
자주 묻는 질문
로컬 개발에 가장 좋은 방법은 무엇인가요?
`DeveloperToolsCredential`을 쓰세요. 로그인용으로 이미 설정되어 있을 수 있는 Azure CLI나 Azure Developer CLI를 사용하려고 시도합니다.
프로그램이 이미 Azure에서 실행 중이라면요?
`ManagedIdentityCredential`을 쓰는 것이 좋습니다. 비밀번호나 비밀 정보 없이 Azure가 인증을 직접 처리합니다.
같은 인증 설정을 여러 클라이언트에 재사용할 수 있나요?
네, 자격 증명은 쉽게 복제할 수 있고 여러 Azure 클라이언트에서 사용할 수 있습니다.
상세 정보
작성자의 원본 설명
Azure Identity SDK for Rust authentication. Use for DeveloperToolsCredential, ManagedIdentityCredential, ClientSecretCredential, and token-based authentication.
인기도
- GitHub 스타
- 48k
- 순위
- #3937
- 라이선스
- MIT
- 업데이트
- 2026. 10. 15.
댓글
- …
이 저장소의 다른 스킬
00-andruia-consultant
48k에이전트가 AI 프로젝트를 시작하거나 개선할 수 있도록 코드를 분석하고 스페인어로 실행 계획을 세워 줍니다.
007
48k에이전트가 보안 감사와 위협 모델링을 수행해 공격과 취약점으로부터 프로젝트를 보호하도록 돕습니다.
10-andruia-skill-smith
48k에이전트가 AI 도구의 작동 방식을 정의하고 문서를 쓰며 구조를 검증하도록 돕습니다.
20-andruia-niche-intelligence
48k에이전트가 신뢰할 수 있는 자료를 바탕으로 특정 산업의 맥락, 규칙, 사용 패턴, 위험을 정리한 요약을 만들도록 돕습니다.
비슷한 스킬
api-connector-builder
280k에이전트가 기존 패턴을 따라 새로운 API 연결을 만들도록 합니다. 새로운 방식을 도입하지 않고 연동을 하나 더 추가할 때 씁니다.
api-design
280k에이전트가 모범 사례에 따라 REST API를 설계하도록 돕습니다. API가 통신하는 방식, 오류를 보여 주는 방식, 데이터를 정리하는 방식을 정하는 데 유용합니다.
backend-patterns
280k에이전트가 서버 쪽 아키텍처 패턴과 데이터베이스 최적화를 다루도록 돕습니다. 서버에서 실행되는 코드를 만들거나 검토할 때 유용합니다.