Azure Identity for TypeScript
Configure secure, flexible Microsoft Entra ID authentication for TypeScript Azure applications.
The documentation recommends managed identity, environment variables, appropriately scoped credentials, and avoiding hardcoded secrets; examples use placeholders, with no evidence of credential theft, covert exfiltration, or destructive defaults. Points are deducted because least-privilege permissions, user confirmation, token data flow, rollback, and post-exposure recovery are not specified, and verbose logging could increase sensitive-data exposure risk.
Installation, environment variables, and multiple credential paths are documented, with some error-handling guidance. Points are deducted for visible inconsistency, including conflicting production recommendations for DefaultAzureCredential versus ManagedIdentityCredential, browser reference material that mixes Node-oriented options, and the absence of skill-specific tests or reproducible validation. Static calibration prevents evidence of runnable key paths from receiving a higher score.
The audience and scenarios are reasonably clear: local development, Azure-hosted environments, CI/CD, Kubernetes, browsers, and sovereign clouds, including Azure China. Points are deducted because non-fit boundaries, precise trigger conditions, version compatibility, and mainland-China reachability are not documented; some authentication and documentation flows depend on overseas services.
The information architecture is readable, with a main document and two progressively separated references covering installation, examples, best practices, debugging, and security. MIT licensing, author, and version metadata are present. Points are deducted for missing skill-specific changelog, explicit maintenance and update path, dependency version constraints, FAQ, and systematic troubleshooting guidance.
The skill provides directly reusable TypeScript authentication snippets, environment-variable templates, credential selection guidance, and browser integration examples that address the core configuration task. Points are deducted because the examples were not executed in this review and some recommendations or browser/API details may be outdated or internally inconsistent, requiring manual verification and adjustment.
Microsoft Learn and aka.ms references provide some traceability, while repository-level CI, evaluation workflows, and test code provide limited audit context. Points are deducted because the supplied tests do not demonstrate coverage of this skill's key paths, and no skill-specific results or third-party execution evidence are supplied; static review cannot independently reproduce the claims.
- Before adopting the snippets, verify them against the current @azure/identity version, DefaultAzureCredential chain, InteractiveBrowserCredential browser/Node applicability, and WorkloadIdentityCredential configuration.
- Do not enable verbose logging with real tokens, client secrets, or other credentials; add least-privilege, consent, secret-rotation, and compromise-recovery controls.
- Validate reachability and enterprise network policy for browser login, Azure endpoints, and external documentation separately.
What it does & when to use it
This skill helps TypeScript and JavaScript developers authenticate Azure SDK clients with Microsoft Entra ID. It covers DefaultAzureCredential, managed identities, service principals, interactive sign-in, developer credentials, and custom credential chains. It also documents sovereign cloud authority hosts, bearer-token providers, logging, and credential-handling practices. It fits projects that need to avoid embedded secrets and use different authentication approaches during local development and production deployment.
Shows how to install @azure/identity and the optional @azure/identity-vscode package; configure secret-based or certificate-based service principals, Kubernetes workload identity, and environment variables; create examples using DefaultAzureCredential, ManagedIdentityCredential, ClientSecretCredential, ClientCertificateCredential, InteractiveBrowserCredential, DeviceCodeCredential, and ChainedTokenCredential; use Visual Studio Code, Azure CLI, Azure Developer CLI, and Azure PowerShell credentials; configure Azure Government and Azure China authority hosts; create a bearer-token provider; implement the TokenCredential interface; and enable verbose Azure SDK logging with a custom logger.
- A TypeScript developer needs DefaultAzureCredential to connect an Azure SDK client such as BlobServiceClient during local development.
- A production service running on Azure needs system-assigned or user-assigned managed identity authentication.
- A Kubernetes workload must authenticate with Azure through a federated token file.
- A backend service needs to authenticate as a service principal with a client secret or certificate.
- An interactive application requires browser-based or device-code sign-in.
- An application needs a custom fallback chain, such as managed identity first and Azure CLI second.
Pros & cons
- Covers local development, production hosting, Kubernetes, and interactive authentication scenarios.
- Provides copyable TypeScript and environment-variable examples.
- Recommends managed identity for production and explicitly advises against hardcoded credentials.
- Includes sovereign clouds, bearer-token providers, custom credential chains, and debugging logs.
- The content is primarily configuration guidance and examples; no skill-specific test suite or test results are provided.
- It does not specify a Node.js version, an @azure/identity version, or a complete runtime compatibility matrix.
- Tenant configuration, permission grants, and Azure resource authorization are not explained in depth.
- Certificate paths, tenant IDs, client IDs, and secrets in the examples must be supplied by the adopter.
How to install
Install the collection with npx skills add microsoft/skills, then select azure-identity-ts in the wizard. The README says skills are installed into the selected agent directory, such as .github/skills/ for GitHub Copilot. The source does not document a standalone installation command for this skill. In the TypeScript project, install @azure/identity; install @azure/identity-vscode only when Visual Studio Code credential support is needed.
How to use
In a TypeScript project, run npm install @azure/identity. Ask the coding agent, for example: “Configure DefaultAzureCredential for this TypeScript Blob Storage client and explain the local-development, production-managed-identity, and environment-variable setup.” Then provide the required AZURE_TENANT_ID, AZURE_CLIENT_ID, and related settings, or choose the managed-identity, CLI, browser, or other credential pattern shown in the skill.