Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Create and configure Microsoft Entra (Azure AD) app registrations, scopes, and service principals
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/sdk/azure-identity-ts.md
1# Authentication — TypeScript SDK Quick Reference23> Condensed from **azure-identity-ts**. Full patterns (sovereign clouds,4> device code flow, custom credentials, bearer token provider)5> in the **azure-identity-ts** plugin skill if installed.67## Install8npm install @azure/identity910## Quick Start11> **Auth:** `DefaultAzureCredential` is for local development. See [auth-best-practices.md](../auth-best-practices.md) for production patterns.1213```typescript14import { DefaultAzureCredential } from "@azure/identity";15const credential = new DefaultAzureCredential();16```1718## Best Practices19- Use DefaultAzureCredential for **local development only** (CLI, PowerShell, VS Code). In production, use ManagedIdentityCredential — see [auth-best-practices.md](../auth-best-practices.md)20- Never hardcode credentials — use environment variables or managed identity21- Prefer managed identity — no secrets to manage in production22- Scope credentials appropriately — use user-assigned identity for multi-tenant scenarios23- Handle token refresh — Azure SDK handles this automatically24- Use ChainedTokenCredential for custom fallback scenarios25