Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Azure Identity SDK for Python authentication. Use for DefaultAzureCredential, managed identity, service principals, and token caching.
.claude/skills/azure-identity-py/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-15 | ✗→✓ | ▲ Improved | — | — |
| case-11 | ✓→✓ | = Same ✓ | — | — |
| case-10 | ✗→✗ | = Same ✗ | — | — |
| case-14 | ✗→✗ | = Same ✗ | — | — |
| case-12 | ✗→✗ | = Same ✗ | — | — |
Authentication library for Azure SDK clients using Microsoft Entra ID (formerly Azure AD).
bashpip install azure-identity
bash# Service Principal (for production/CI) AZURE_TENANT_ID=<your-tenant-id> AZURE_CLIENT_ID=<your-client-id> AZURE_CLIENT_SECRET=<your-client-secret> # User-assigned Managed Identity (optional) AZURE_CLIENT_ID=<managed-identity-client-id>
The recommended credential for most scenarios. Tries multiple authentication methods in order:
pythonfrom azure.identity import DefaultAzureCredential from azure.storage.blob import BlobServiceClient # Works in local dev AND production without code changes credential = DefaultAzureCredential() client = BlobServiceClient( account_url="https://<account>.blob.core.windows.net", credential=credential )
| Order | Credential | Environment | |-------|-----------|-------------| | 1 | EnvironmentCredential | CI/CD, containers | | 2 | WorkloadIdentityCredential | Kubernetes | | 3 | ManagedIdentityCredential | Azure VMs, App Service, Functions | | 4 | SharedTokenCacheCredential | Windows only | | 5 | VisualStudioCodeCredential | VS Code with Azure extension | | 6 | AzureCliCredential | az login | | 7 | AzurePowerShellCredential | Connect-AzAccount | | 8 | AzureDeveloperCliCredential | azd auth login |
python# Exclude credentials you don't need credential = DefaultAzureCredential( exclude_environment_credential=True, exclude_shared_token_cache_credential=True, managed_identity_client_id="<user-assigned-mi-client-id>" # For user-assigned MI ) # Enable interactive browser (disabled by default) credential = DefaultAzureCredential( exclude_interactive_browser_credential=False )
For Azure-hosted resources (VMs, App Service, Functions, AKS):
pythonfrom azure.identity import ManagedIdentityCredential # System-assigned managed identity credential = ManagedIdentityCredential() # User-assigned managed identity credential = ManagedIdentityCredential( client_id="<user-assigned-mi-client-id>" )
For service principal with secret:
pythonfrom azure.identity import ClientSecretCredential credential = ClientSecretCredential( tenant_id=os.environ["AZURE_TENANT_ID"], client_id=os.environ["AZURE_CLIENT_ID"], client_secret=os.environ["AZURE_CLIENT_SECRET"] )
Uses the account from az login:
pythonfrom azure.identity import AzureCliCredential credential = AzureCliCredential()
Custom credential chain:
pythonfrom azure.identity import ( ChainedTokenCredential, ManagedIdentityCredential, AzureCliCredential ) # Try managed identity first, fall back to CLI credential = ChainedTokenCredential( ManagedIdentityCredential(client_id="<user-assigned-mi-client-id>"), AzureCliCredential() )
| Credential | Use Case | Auth Method | |------------|----------|-------------| | DefaultAzureCredential | Most scenarios | Auto-detect | | ManagedIdentityCredential | Azure-hosted apps | Managed Identity | | ClientSecretCredential | Service principal | Client secret | | ClientCertificateCredential | Service principal | Certificate | | AzureCliCredential | Local development | Azure CLI | | AzureDeveloperCliCredential | Local development | Azure Developer CLI | | InteractiveBrowserCredential | User sign-in | Browser OAuth | | DeviceCodeCredential | Headless/SSH | Device code flow |
pythonfrom azure.identity import DefaultAzureCredential credential = DefaultAzureCredential() # Get token for a specific scope token = credential.get_token("https://management.azure.com/.default") print(f"Token expires: {token.expires_on}") # For Azure Database for PostgreSQL token = credential.get_token("https://ossrdbms-aad.database.windows.net/.default")
pythonfrom azure.identity.aio import DefaultAzureCredential from azure.storage.blob.aio import BlobServiceClient async def main(): credential = DefaultAzureCredential() async with BlobServiceClient( account_url="https://<account>.blob.core.windows.net", credential=credential ) as client: # ... async operations pass await credential.close()
This skill is applicable to execute the workflow or actions described in the overview.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-10 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-14 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-12 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-13 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-06 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-20 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-03 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-08 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-21 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-19 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-09 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-11 | pass→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-15 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-22 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-02 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-01 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-04 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-05 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-07 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-16 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-17 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-18 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +5 percentage points is the difference between those two pass rates over the 22 comparable cases.
The per-case answers from this run were removed by the retention sweep, so the case table below shows the verdicts without the text either arm produced. The counts above were recorded at the time and are unaffected. Answers are now kept for 180 days.
Other measured skills in the registry, with their headline benchmark lift.