azure-postgres-ts

Connect Node.js and TypeScript apps to Azure PostgreSQL Flexible Server.

Updated Apr 12, 2026
One-click install
npx skills add https://github.com/davidrrowley/CortexYouV3 --skill azure-postgres-ts
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: azure-postgres-ts
Source: https://github.com/davidrrowley/CortexYouV3/tree/main/.agents/skills/azure-postgres-ts
Command: npx skills add https://github.com/davidrrowley/CortexYouV3 --skill azure-postgres-ts

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Provides clear, production-oriented guidance to connect Node.js and TypeScript applications to Azure Database for PostgreSQL Flexible Server, removing uncertainty around authentication, SSL, pooling, transactions, and token refresh. It helps teams avoid common pitfalls like disabled SSL, SQL injection, leaked connections, and expired Entra ID tokens.

Core Features & Use Cases

  • Secure Authentication: Demonstrates both password-based and Microsoft Entra ID (passwordless) authentication flows and how to acquire and refresh tokens.
  • Connection Management & Pooling: Shows recommended Pool configuration, explicit checkout/release patterns, graceful shutdown, and pool sizing guidance for different workloads.
  • Safe Querying & Transactions: Emphasizes parameterized queries to prevent injection, transaction helpers with rollback semantics, typed TypeScript query results, and structured error handling.
  • Use Case: Implement a backend service that uses Entra ID for passwordless connections, runs transactional order processing, and scales safely under connection limits.

Quick Start

Connect your Node.js TypeScript app to an Azure PostgreSQL Flexible Server using the node-postgres package and DefaultAzureCredential for passwordless authentication.

Frequently Asked Questions about azure-postgres-ts

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I connect Node.js and TypeScript to Azure Database for PostgreSQL Flexible Server?

Connect Node.js and TypeScript to Azure PostgreSQL Flexible Server using the node-postgres package, configuring SSL-enforced connections and Microsoft Entra ID for passwordless authentication.

What is the best way to handle Microsoft Entra ID token refresh in a Node.js PostgreSQL connection pool?

Handle Entra ID token refresh in a Node.js PostgreSQL connection pool by acquiring tokens via DefaultAzureCredential and implementing explicit pool lifecycle management for long-running production services.

Can I use Microsoft Entra ID passwordless authentication with node-postgres in TypeScript?

Yes, you can use Microsoft Entra ID passwordless authentication with node-postgres in TypeScript by acquiring tokens with DefaultAzureCredential and passing them in the pool configuration.

How do I prevent SQL injection and manage transactions in TypeScript PostgreSQL queries?

Prevent SQL injection and manage transactions in TypeScript PostgreSQL queries by using parameterized queries and transaction helpers with rollback semantics to ensure safe database access.

Why does my Azure PostgreSQL connection pool leak connections in a long-running production service?

Your Azure PostgreSQL connection pool may leak connections without explicit checkout/release patterns and graceful shutdown, requiring proper pool sizing guidance and lifecycle management to resolve.

Do I need SSL enforced for Azure Database for PostgreSQL Flexible Server connections?

Yes, SSL-enforced connections are required for Azure Database for PostgreSQL Flexible Server to ensure secure and managed database access from Node.js and TypeScript applications.