azure-postgres

Configure passwordless Entra ID authentication for Azure PostgreSQL Flexible Server.

242|189|Updated Oct 28, 2024
One-click install
npx skills add https://github.com/microsoft/GitHub-Copilot-for-Azure --skill azure-postgres
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: azure-postgres
Source: https://github.com/microsoft/GitHub-Copilot-for-Azure/tree/main/plugin/skills/azure-postgres
Command: npx skills add https://github.com/microsoft/GitHub-Copilot-for-Azure --skill azure-postgres

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires az, psql, jq, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This skill enables passwordless authentication for Azure Database for PostgreSQL Flexible Server using Microsoft Entra ID, simplifying access control for developers, apps, and teams while enabling secure migrations away from passwords.

Core Features & Use Cases

  • Migrate existing PostgreSQL servers from password-based authentication to Entra ID authentication.
  • Configure developer access with Azure identities and managed identities for applications.
  • Implement group-based access control with regular synchronization of group members.
  • Follow best practices for token-based connections and RBAC templates when granting permissions.

Quick Start

Prepare your Azure PostgreSQL server for Entra ID authentication by configuring an Entra admin, then apply identity mappings and permissions using the included scripts. For common tasks, run:

  • Create an Entra admin and enable Entra authentication on your server with the provided scripts (scripts/az-commands.sh).
  • Map a user: scripts/setup-user.sh <resource-group> <server-name> <user-upn> <database> <permission-level>.
  • Map a group: scripts/setup-group.sh <resource-group> <server-name> <group-name> <database> <permission-level> [enable-sync].
  • Use tokens for authentication: export PGPASSWORD=$(az account get-access-token --resource-type oss-rdbms --query accessToken -o tsv) and connect with psql.

Frequently Asked Questions about azure-postgres

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

FAQPage Schema
How do I configure passwordless Entra ID authentication for Azure PostgreSQL Flexible Server?

Passwordless Entra ID authentication for Azure PostgreSQL Flexible Server is configured by setting an Entra admin, then applying identity mappings and RBAC permission templates via CLI scripts to manage access.

Can I migrate an existing Azure PostgreSQL server from password-based authentication to Entra ID?

Migrating Azure PostgreSQL servers from password-based authentication to Entra ID involves mapping existing users and groups to Azure identities using the provided setup scripts.

How do I map an Azure AD group to a PostgreSQL database role with regular synchronization?

Mapping an Azure AD group to a PostgreSQL database role with regular synchronization requires running the setup-group script with the enable-sync flag to maintain accurate group member permissions.

Do I need Azure CLI and psql to connect to Azure PostgreSQL using Entra ID tokens?

Connecting to Azure PostgreSQL using Entra ID tokens requires Azure CLI and psql. You export the access token via Azure CLI and pass it as the PGPASSWORD environment variable to psql.

What's the best way to implement group-based access control for Azure PostgreSQL?

Implementing group-based access control for Azure PostgreSQL is best achieved using Entra ID group mapping scripts that apply RBAC permission templates and synchronize group members regularly.