jpskill.com
🛠️ 開発・MCP コミュニティ

azure-postgres

Create new Azure Database for PostgreSQL Flexible Server instances and configure passwordless authentication with Microsoft Entra ID. Set up developer access, managed identities for apps, group-based permissions, and migrate from password-based to Entra ID authentication. Trigger phrases include "passwordless for postgres", "entra id postgres", "azure ad postgres authentication", "postgres managed identity", "migrate postgres to passwordless".

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o azure-postgres.zip https://jpskill.com/download/19670.zip && unzip -o azure-postgres.zip && rm azure-postgres.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/19670.zip -OutFile "$d\azure-postgres.zip"; Expand-Archive "$d\azure-postgres.zip" -DestinationPath $d -Force; ri "$d\azure-postgres.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して azure-postgres.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → azure-postgres フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
15

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

[Skill 名] azure-postgres

Azure Database for PostgreSQL

既存の Azure Database for PostgreSQL Flexible Server で、Microsoft Entra ID を使用したパスワードなし認証を構成します。このスキルは、Entra ID 認証の設定、ユーザーアクセス管理、およびパスワードベース認証からの移行に焦点を当てています。

主なユースケース:

  • 既存の PostgreSQL データベースをパスワード認証から Entra ID 認証へ移行する
  • Azure ID を使用して開発者アクセスを設定する
  • Azure ホスト型アプリケーション向けにマネージド ID アクセスを構成する
  • グループベースのアクセス制御と権限を管理する

MCP ツール (推奨)

Azure MCP が有効な場合、PostgreSQL 操作には以下のツールを使用します。

  • azure__postgres とコマンド postgres_server_list - PostgreSQL サーバーを一覧表示します
  • azure__postgres とコマンド postgres_database_list - サーバー上のデータベースを一覧表示します
  • azure__postgres とコマンド postgres_database_query - SQL クエリを実行します
  • azure__postgres とコマンド postgres_server_param_get - サーバーパラメーターを取得します
  • azure__postgres とコマンド postgres_server_param_set - サーバーパラメーターを設定します

CLI コマンド (フォールバック)

az postgres flexible-server list --output table
az postgres flexible-server db list --server-name SERVER -g RG
az postgres flexible-server show --name SERVER -g RG
az postgres flexible-server create --name SERVER -g RG --location REGION --admin-user ADMIN --version 16

クイックリファレンス

プロパティ
CLI プレフィックス az postgres flexible-server
MCP ツール azure__postgres
最適な用途 リレーショナルデータ、PostgreSQL 互換性、PostGIS
エンジンバージョン PostgreSQL 11, 12, 13, 14, 15, 16 (推奨)

既存の PostgreSQL サーバーでの作業

このスキルは主に、既存の PostgreSQL サーバーの認証構成に焦点を当てています。サーバーを参照または作成する必要がある場合は、MCP ツールまたは CLI コマンドを使用し、簡単にアクセスできるように Azure Portal のリンクを提供してください。

ポータルリンクの形式:

https://portal.azure.com/#@{tenant-domain}/resource/subscriptions/{subscription-id}/resourceGroups/{resource-group}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{server-name}/overview

ポータルリンクの例:

Azure Portal で表示:
https://portal.azure.com/#resource/subscriptions/abc123.../resourceGroups/myrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/myserver/overview

Microsoft Entra ID 認証 (重要)

⚠️ 本番ワークロードでは、常に Entra ID を使用したパスワードなし認証を使用してください。

完全なセットアップガイド

→ Microsoft Entra ID 認証セットアップガイド

このガイドの内容:

  • PostgreSQL サーバーで Entra ID 認証を有効にする
  • Azure ID にマッピングされた PostgreSQL ロールを作成する
  • データベース権限を付与する
  • パスワードではなくアクセストークンで接続する

クイックセットアップパターン

シナリオに基づいてこれらのパターンを使用してください。

シナリオ ガイドリンク 使用する場合
開発者アクセス パターン 1 開発者に Azure ID でアクセスを許可する
アプリ認証 パターン 2 Azure ホスト型アプリ (Container Apps, App Service, Functions) のパスワードなしアクセス
チームアクセス パターン 3 Azure AD グループを介して権限を管理する
接続の問題 トラブルシューティング 認証と接続の失敗を診断する
移行 パターン 5 パスワード認証から Entra ID 認証へ移行する

サービスティア

ティア vCore メモリ ユースケース
バースト可能 1-20 0.5-4 GB/vCore 開発/テスト、低トラフィック
汎用 2-64 4 GB/vCore ほとんどの本番ワークロード
メモリ最適化 2-64 8 GB/vCore 高メモリワークロード

開発/テストにはバースト可能から始め、必要に応じてスケールアップしてください。

よくある問題

問題 原因 解決策
role does not exist データベースにロールが作成されていない pgaadauth_create_principal を実行する - ガイドを参照
password authentication failed トークンの有効期限切れ (5-60 分の有効期間) 新しいトークンを取得する: az account get-access-token --resource-type oss-rdbms
permission denied ロールに権限がない GRANT ステートメントを実行する - テンプレートを参照
接続タイムアウト ファイアウォールがアクセスをブロックしている ファイアウォールルールを追加する: az postgres flexible-server firewall-rule create
ゲストユーザーログイン失敗 UPN 形式が間違っている Azure AD から #EXT# タグ付きの完全な UPN を使用する

SDK クイックリファレンス

リファレンス

📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Azure Database for PostgreSQL

Configure passwordless authentication with Microsoft Entra ID for existing Azure Database for PostgreSQL Flexible Server. This skill focuses on setting up Entra ID authentication, managing user access, and migrating from password-based authentication.

Primary use cases:

  • Migrating existing PostgreSQL databases from password to Entra ID authentication
  • Setting up developer access with Azure identities
  • Configuring managed identity access for Azure-hosted applications
  • Managing group-based access control and permissions

MCP Tools (Preferred)

When Azure MCP is enabled, use these tools for PostgreSQL operations:

  • azure__postgres with command postgres_server_list - List PostgreSQL servers
  • azure__postgres with command postgres_database_list - List databases on a server
  • azure__postgres with command postgres_database_query - Execute SQL queries
  • azure__postgres with command postgres_server_param_get - Get server parameters
  • azure__postgres with command postgres_server_param_set - Set server parameters

CLI Commands (Fallback)

az postgres flexible-server list --output table
az postgres flexible-server db list --server-name SERVER -g RG
az postgres flexible-server show --name SERVER -g RG
az postgres flexible-server create --name SERVER -g RG --location REGION --admin-user ADMIN --version 16

Quick Reference

Property Value
CLI prefix az postgres flexible-server
MCP tools azure__postgres
Best for Relational data, PostgreSQL compatibility, PostGIS
Engine versions PostgreSQL 11, 12, 13, 14, 15, 16 (recommended)

Working with Existing PostgreSQL Servers

This skill primarily focuses on configuring authentication for existing PostgreSQL servers. If you need to reference or create servers, use MCP tools or CLI commands, and provide Azure Portal links for easy access.

Portal Link Format:

https://portal.azure.com/#@{tenant-domain}/resource/subscriptions/{subscription-id}/resourceGroups/{resource-group}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{server-name}/overview

Example portal link:

View in Azure Portal:
https://portal.azure.com/#resource/subscriptions/abc123.../resourceGroups/myrg/providers/Microsoft.DBforPostgreSQL/flexibleServers/myserver/overview

Microsoft Entra ID Authentication (Critical)

⚠️ ALWAYS use passwordless authentication with Entra ID for production workloads.

Complete Setup Guide

→ Microsoft Entra ID Authentication Setup Guide

This guide covers:

  • Enabling Entra ID authentication on PostgreSQL servers
  • Creating PostgreSQL roles mapped to Azure identities
  • Granting database permissions
  • Connecting with access tokens instead of passwords

Quick Setup Patterns

Use these patterns based on your scenario:

Scenario Guide Link Use When
Developer Access Pattern 1 Grant developers access with their Azure identity
App Authentication Pattern 2 Passwordless access for Azure-hosted apps (Container Apps, App Service, Functions)
Team Access Pattern 3 Manage permissions via Azure AD groups
Connection Issues Troubleshooting Diagnose authentication and connection failures
Migration Pattern 5 Transition from password to Entra ID authentication

Service Tiers

Tier vCores Memory Use Case
Burstable 1-20 0.5-4 GB/vCore Dev/test, low traffic
General Purpose 2-64 4 GB/vCore Most production workloads
Memory Optimized 2-64 8 GB/vCore High-memory workloads

Start with Burstable for dev/test, scale up as needed.

Common Issues

Issue Cause Solution
role does not exist Role not created in database Run pgaadauth_create_principal - see guide
password authentication failed Token expired (5-60 min validity) Get fresh token: az account get-access-token --resource-type oss-rdbms
permission denied Role lacks permissions Run GRANT statements - see templates
Connection timeout Firewall blocking access Add firewall rule: az postgres flexible-server firewall-rule create
Guest user login fails Wrong UPN format Use full UPN with #EXT# tag from Azure AD

SDK Quick References

References

同梱ファイル

※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。