Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Deploy applications and infrastructure to Azure using Copilot-guided workflows and Azure MCP
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 Start1112> **Auth:** `DefaultAzureCredential` is for local development. See [auth-best-practices.md](../auth-best-practices.md) for production patterns.1314```typescript15import { DefaultAzureCredential } from "@azure/identity";16const credential = new DefaultAzureCredential();17```1819## Best Practices20- Use DefaultAzureCredential for **local development only** (CLI, PowerShell, VS Code). In production, use ManagedIdentityCredential — see [auth-best-practices.md](../auth-best-practices.md)21- Never hardcode credentials — use environment variables or managed identity22- Prefer managed identity — no secrets to manage in production23- Scope credentials appropriately — use user-assigned identity for multi-tenant scenarios24- Handle token refresh — Azure SDK handles this automatically25- Use ChainedTokenCredential for custom fallback scenarios26