azure-postgres-ts

Connect Node.js/TypeScript apps to Azure Database for PostgreSQL using pg.

2.9k|323|Updated Jan 16, 2026
One-click install
npx skills add https://github.com/microsoft/skills --skill azure-postgres-ts-microsoft
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: azure-postgres-ts
Source: https://github.com/microsoft/skills/tree/main/.github/plugins/azure-sdk-typescript/skills/azure-postgres-ts
Command: npx skills add https://github.com/microsoft/skills --skill azure-postgres-ts-microsoft

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Connects Node.js/TypeScript apps to Azure Database for PostgreSQL Flexible Server using the pg library, enabling secure, scalable database access with either password-based or Microsoft Entra ID (passwordless) authentication.

Core Features & Use Cases

  • Cloud-grade authentication: password or Entra ID passwordless authentication with DefaultAzureCredential or ManagedIdentityCredential.
  • Reliable connections: pool-based access for scalable apps and support for transactions.
  • Type-safe queries: examples show typed queries with pg.

Quick Start

Install the required packages and configure environment variables to establish a connection to your Azure PostgreSQL server.

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 a Node.js app to Azure PostgreSQL using Entra ID passwordless authentication?

You connect Node.js apps to Azure Database for PostgreSQL Flexible Server passwordlessly by using the pg library with Microsoft Entra ID. The Skill configures token-based authentication using DefaultAzureCredential or ManagedIdentityCredential from the @azure/identity package.

What is the best way to manage connection pooling for Azure Database for PostgreSQL in TypeScript?

The best way to manage connection pooling for Azure Database for PostgreSQL in TypeScript is using the pg library's pool-based access. This Skill configures pool connections to ensure reliable, scalable database queries and transactional workflows across development and production environments.

Can I use the pg library with Microsoft Entra ID instead of a password for Azure PostgreSQL Flexible Server?

Yes, you can use the pg library with Microsoft Entra ID instead of a password for Azure PostgreSQL Flexible Server. This Skill supports both password-based and token-based Entra ID authentication via the @azure/identity package to secure your database access.

What environment variables do I need to set up an Azure PostgreSQL connection in a Node.js application?

You need environment variables for the host, database, user, and authentication method to establish an Azure PostgreSQL connection in Node.js. This Skill uses these variables to configure the pg library for either password or Entra ID token-based access.

Does this Skill support transactional workflows and type-safe queries for Azure PostgreSQL?

Yes, this Skill supports transactional workflows and type-safe queries for Azure PostgreSQL. It uses the pg library to enable pool-based access for scalable apps and provides examples showing typed queries within Node.js or TypeScript applications.

Why use ManagedIdentityCredential for Azure PostgreSQL access in Node.js?

You use ManagedIdentityCredential for Azure PostgreSQL access in Node.js to enable cloud-grade, passwordless authentication. This Skill applies Microsoft Entra ID with ManagedIdentityCredential to secure access without storing passwords, ensuring scalable and reliable database connections.