# Implement Azure Authentication in TypeScript

Azure authentication choices can be difficult to configure securely. This skill provides focused TypeScript examples for Azure Identity credentials, token providers, and cloud environments.

## Install

```bash
npx skillstore add sickn33/azure-identity-ts
```

## Metadata

- Status: approved
- Slug: sickn33-azure-identity-ts
- Skillstore revision: r2
- Version status: missing
- Tree hash: cac2e7dc0d954b05747d0d6a5800b55ea526f73028479afe8497239e681722ad
- Author: sickn33
- GitHub username: sickn33
- License: MIT
- Repository: https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/azure-identity-ts
- Ref: f9e2c34b4f19c7f3e6b0a1e93227b5f77cc12526
- Supported tools: Claude, Codex, Claude Code
- Audit status: complete
- Agent install advisory: allowed
- Manual install advisory: allowed
- Artifact signature: available
- Audit attestation: unavailable
- Human verification: not\_verified
- Risk factors: external\_commands, network, filesystem, env\_access
- Quality score: 78
- Quality tier: bronze
- Public page: https://skillstore.pages.dev/skills/sickn33-azure-identity-ts
- Manifest: https://skillstore.pages.dev/api/skills/sickn33-azure-identity-ts/manifest

## Capabilities

- Select and configure DefaultAzureCredential for development and production.
- Set up managed identities by system assignment, client ID, or resource ID.
- Create service principal credentials using secrets or certificates.
- Configure browser, device code, Azure CLI, Azure PowerShell, and Azure Developer CLI credentials.
- Build custom credential chains and bearer token providers for Azure scopes.
- Configure authority hosts for Azure Government and Azure China.

## Use Cases

- Authenticate an Azure SDK Client: Add DefaultAzureCredential to a TypeScript service that accesses Azure Storage or another Azure SDK client.
- Replace Application Secrets: Plan a migration from client secrets to managed identity for an Azure-hosted workload.
- Design a Credential Strategy: Compare credential chains, sovereign cloud authorities, and developer login options for a multi-environment application.

## Prompt Templates

### Set Up Default Credential

```
Add Azure authentication to my TypeScript application using DefaultAzureCredential. Explain required packages, local prerequisites, and production behavior for [Azure service].
```

### Configure Managed Identity

```
Configure [system-assigned or user-assigned] managed identity for my TypeScript service running on [Azure host]. Include required identifiers and validation steps.
```

### Choose a Service Principal

```
Compare client secret and certificate credentials for [application]. Recommend one based on deployment, rotation, and operational requirements.
```

### Design an Advanced Credential Chain

```
Design an Azure Identity strategy for [environments]. Include credential order, sovereign cloud support, failure handling, token scopes, and least-privilege controls.
```

## Limitations

- Provides guidance and examples but does not execute Azure authentication or verify tenant configuration.
- Requires the Azure Identity package and valid identities, permissions, endpoints, and local developer tools.
- Does not cover role assignment creation, tenant administration, certificate provisioning, or secret rotation.
- Examples use placeholders and require environment-specific testing before production use.

## Best Practices

- Use DefaultAzureCredential when one code path must support local development and Azure hosting.
- Prefer managed identity for production workloads to avoid storing client secrets.
- Grant each identity only the Azure roles and scopes required by its workload.

## Anti Patterns

- Do not commit tenant secrets, certificate passwords, access tokens, or private keys.
- Do not use interactive browser or device code credentials for unattended production services.
- Do not enable verbose authentication logging without reviewing logs for sensitive operational details.

## Security Audit

- Audited at: 2026-07-23T21:59:41.964\+00:00
- Summary: All static findings are false positives caused by Markdown fences, SDK class names, Azure endpoint examples, or placeholder credential configuration. No prompt injection, credential exfiltration, unauthorized command execution, or other malicious intent was found.

## Stats

- Views: 76
- Downloads: 8
- Favorites: 0
- Popularity score: 0
