المهارات Azure Identity SDK for Python
📦

Azure Identity SDK for Python

آمن

Implement Azure Authentication in Python

Developers struggle with Azure SDK authentication across local development and cloud deployments. This skill provides unified credential patterns that work seamlessly in both environments.

يدعم: Claude Codex Code(CC)
📊 70 كافٍ
1

تنزيل ZIP المهارة

2

رفع في Claude

اذهب إلى Settings → Capabilities → Skills → Upload skill

3

فعّل وابدأ الاستخدام

اختبرها

استخدام "Azure Identity SDK for Python". Basic DefaultAzureCredential setup for Blob Storage

النتيجة المتوقعة:

Configure DefaultAzureCredential, which automatically tries multiple authentication methods. Locally it uses Azure CLI credentials, while in Azure it uses managed identity.

استخدام "Azure Identity SDK for Python". Async credential handling pattern

النتيجة المتوقعة:

Use the azure.identity.aio module with context managers. The async credential is automatically closed when exiting the async with block, ensuring proper resource cleanup.

التدقيق الأمني

آمن
v1 • 2/24/2026

Static analysis scanned 0 files with 0 total lines. No executable code or suspicious patterns detected. This is a documentation skill providing guidance on Azure Identity SDK usage. Risk score is 0/100. Safe to publish.

0
الملفات التي تم فحصها
0
الأسطر التي تم تحليلها
0
النتائج
1
إجمالي عمليات التدقيق
لا توجد مشكلات أمنية
تم تدقيقه بواسطة: claude

درجة الجودة

38
الهندسة المعمارية
100
قابلية الصيانة
87
المحتوى
31
المجتمع
100
الأمان
83
الامتثال للمواصفات

ماذا يمكنك بناءه

Python Developer Building Azure Cloud Applications

Implement seamless authentication that works locally with Azure CLI and in production with managed identity.

DevOps Engineer Setting Up CI/CD Pipelines

Configure service principal authentication for automated deployments using environment variables.

Solutions Architect Designing Multi-Environment Applications

Create credential chains that handle development, staging, and production environments with appropriate auth methods.

جرّب هذه الموجهات

Basic Azure Authentication Setup
Help me authenticate my Python application with Azure using DefaultAzureCredential. I need to connect to Azure Blob Storage.
Managed Identity Configuration
Show me how to use ManagedIdentityCredential for my Azure Function with a user-assigned managed identity. Include the required client_id parameter.
Service Principal for CI/CD
I need to set up ClientSecretCredential for my GitHub Actions pipeline. Show me the environment variables and Python code to authenticate with Azure.
Custom Credential Chain with Token Retrieval
Create a ChainedTokenCredential that tries managed identity first, then falls back to Azure CLI. Include code to get tokens for Azure Database for PostgreSQL.

أفضل الممارسات

  • Use DefaultAzureCredential for code that runs both locally and in Azure without modification
  • Prefer managed identity over service principals for production Azure deployments
  • Exclude unused credential types to reduce authentication latency

تجنب

  • Hardcoding client secrets or connection strings directly in source code
  • Using InteractiveBrowserCredential in production server applications
  • Not closing async credentials explicitly, leading to resource leaks

الأسئلة المتكررة

What is the recommended credential for most scenarios?
DefaultAzureCredential is recommended as it automatically selects the best authentication method based on the environment, working seamlessly in both local development and Azure deployments.
How does DefaultAzureCredential choose which credential to use?
It tries credentials in order: EnvironmentCredential, WorkloadIdentityCredential, ManagedIdentityCredential, SharedTokenCacheCredential, VisualStudioCodeCredential, AzureCliCredential, AzurePowerShellCredential, and AzureDeveloperCliCredential.
When should I use managed identity instead of service principal?
Use managed identity for applications running on Azure (VMs, App Service, Functions) as it eliminates credential management. Use service principals for CI/CD pipelines and non-Azure environments.
How do I use a specific credential instead of the default chain?
Instantiate the specific credential class directly, such as ClientSecretCredential or AzureCliCredential, instead of DefaultAzureCredential.
Can I customize the order of credentials in the chain?
Yes, use ChainedTokenCredential to create a custom chain with credentials in your preferred order of precedence.
How do I handle async applications with Azure credentials?
Use the azure.identity.aio module and close credentials explicitly with await credential.close() or use async context managers for automatic cleanup.

تفاصيل المطور

المؤلف

sickn33

الترخيص

MIT

مرجع

main

بنية الملفات

📄 SKILL.md