# Build Secure Azure PostgreSQL Clients in TypeScript

Connecting Node.js applications to Azure PostgreSQL requires secure authentication, pooling, and reliable query patterns. This skill provides focused TypeScript guidance for password and Microsoft Entra ID connections.

## Install

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

## Metadata

- Status: approved
- Slug: sickn33-azure-postgres-ts
- Skillstore revision: r2
- Version status: missing
- Tree hash: adcccfefcfee8d2c3526321717e10a86d42d3bda261448771f3d3e4706695a20
- Author: sickn33
- GitHub username: sickn33
- License: MIT
- Repository: https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/azure-postgres-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-postgres-ts
- Manifest: https://skillstore.pages.dev/api/skills/sickn33-azure-postgres-ts/manifest

## Capabilities

- Configure node-postgres clients and pools for Azure PostgreSQL Flexible Server with SSL verification.
- Implement password authentication or Microsoft Entra ID authentication with DefaultAzureCredential.
- Create parameterized queries, transactions, helper functions, and typed query results.
- Manage Entra ID token acquisition, expiration checks, and pool replacement.
- Handle common PostgreSQL errors and connection pool lifecycle events.
- Choose pool sizes, timeouts, and monitoring properties for different workloads.

## Use Cases

- Create a service connection: Build a first TypeScript connection with password authentication, SSL verification, and reliable cleanup.
- Adopt passwordless authentication: Replace stored database passwords with Microsoft Entra ID tokens and managed identity configuration.
- Harden production data access: Review pooling, transactions, parameterized queries, token refresh, and database error handling.

## Prompt Templates

### Connect with a password

```
Create a TypeScript Azure PostgreSQL client using node-postgres, password authentication, SSL verification, environment variables, and guaranteed cleanup.
```

### Create a connection pool

```
Build a reusable node-postgres pool with sensible limits, timeouts, parameterized queries, error handling, and graceful shutdown.
```

### Add managed identity

```
Convert my Azure PostgreSQL configuration to DefaultAzureCredential, explain required environment values, and implement token refresh without logging secrets.
```

### Design production data access

```
Design a typed TypeScript data layer using pooling, transaction helpers, parameterized queries, Entra ID token renewal, metrics, and structured database errors.
```

## Limitations

- It does not provision Azure servers, firewall rules, databases, or managed identities.
- Examples require adaptation for your schema, deployment environment, and access policies.
- It does not validate credentials or execute deployments automatically.
- It does not cover migrations, object-relational mappers, backups, or high availability.

## Best Practices

- Prefer Microsoft Entra ID and managed identities when the deployment environment supports them.
- Use parameterized queries, verified SSL, bounded pools, explicit timeouts, and graceful shutdown.
- Test token renewal, transaction rollback, connection exhaustion, and database outages before production release.

## Anti Patterns

- Do not concatenate user input into SQL statements.
- Do not embed database passwords, access tokens, or complete connection strings in source code or logs.
- Do not create an unbounded pool or leave clients checked out after failures.

## Security Audit

- Audited at: 2026-07-23T22:12:03.72\+00:00
- Summary: All 121 static findings are false positives caused by Markdown formatting, documentation URLs, standard process.env configuration, and illustrative parameterized SQL. The file contains guidance only, with no executable scripts, hidden-file access, credential exfiltration, system reconnaissance, or prompt injection.

## Stats

- Views: 116
- Downloads: 9
- Favorites: 0
- Popularity score: 0
