Azure AI Search のデータソースとして Cosmos DB for PostgreSQL を利用する方法について

watanabe.t 0 評価のポイント
2025-10-27T08:35:40.2066667+00:00

現在、Azure Cosmos DB for PostgreSQL に格納されたデータを Azure AI Search のインデックスに取り込みたいと考えています。

ドキュメント上(Data sources gallery)では、Cosmos DB (NoSQL) や Azure SQL Database などの標準データソースが紹介されていますが、Cosmos DB for PostgreSQL はリストに含まれていません。
そのため、現時点で標準の「データソース+インデクサー」構成では直接連携できないと理解しています。

一方で、次のような要件があります:

  • データはすでに Cosmos DB for PostgreSQL に格納されている
  • 可能な限りコストを抑えて、Azure AI Search にインデックスを作成・更新したい
  • 高頻度で更新されるデータではない(=バッチ連携でも問題なし)

このような場合、実現方法として以下のようなアプローチを検討しています:

  1. アプリケーション側でプッシュ型連携
    • アプリまたは Azure Function などから、Cosmos DB for PostgreSQL のデータを定期的に取得し、Search SDK または REST API 経由でインデックスを更新
  2. 中間ストレージ経由(Blob / Data Lake)での間接取り込み
    • PostgreSQL → Azure Functionsなどで定期エクスポート → Blob Storage (JSON/CSV) → Azure AI Search インデクサー

ただし、これらの方法はそれぞれ運用コスト・開発コストが異なるため、
「実装負荷とコストを抑えつつ、Cosmos DB for PostgreSQL のデータを AI Search に反映するベストプラクティス」があれば知りたいです。

同様の構成を検討・実装された方がいらっしゃれば、
どのような方法を採用されたか、もしくは推奨される設計パターンがあればご教示いただきたいです。


参考


補足:
最終的には、社内向けFAQ検索やRAGシステムのデータ基盤として利用する想定です。

Azure AI 検索
Azure AI 検索

情報を強化する人工知能機能が組み込まれた Azure の検索サービスで、関連するコンテンツの特定と探索を大規模に支援します。


1 件の回答

並べ替え方法: 最も役に立つ
  1. Anonymous
    2025-12-22T08:37:06.25+00:00

    Hey Watanabe, it sounds like you're trying to figure out how to integrate Azure Cosmos DB for PostgreSQL with Azure AI Search for indexing your data. Currently, as you mentioned, there’s no direct support for Cosmos DB for PostgreSQL as a data source in Azure AI Search, which means you will need to use an alternative approach to get your data indexed.

    Here are two potential methods you can consider, which you already identified:

    1. Application-side Push Integration

    You can set up an application or Azure Function to periodically fetch data from Cosmos DB for PostgreSQL and then use the Azure Search SDK or REST API to update the indexes. This method allows you to control how often the data is synced and could be cost-effective since you can run it based on your requirements.

    Steps:

    • Set up an Azure Function or a scheduled job in your application to query data from your Cosmos DB.
    • Use the Azure Search SDK or REST API to push the data to your Azure AI Search service.
    • Since your data doesn't change frequently, batching this operation could help reduce costs.

    2. Intermediate Storage with Blob/ Data Lake

    This method involves exporting data from your PostgreSQL database to an intermediary storage service, like Azure Blob Storage or Data Lake, and then using an indexer in Azure AI Search to process the stored files.

    Steps:

    • Use an Azure Function or scheduled job to periodically export data from Cosmos DB for PostgreSQL to Blob Storage or Data Lake in a suitable format (like JSON/CSV).
    • Configure an Azure AI Search indexer to read from that Blob/ Data Lake to index the data.

    Best Practices and Considerations

    • Cost Management: Evaluate the cost differences between these two approaches based on frequency, data volume, and Azure Function executions.
    • Error Handling: Implement error handling and logging to manage any failures during data retrieval or index updates.
    • Scalability: Ensure that whichever approach you choose can scale effectively with your data size and update frequency.

    Reference Documentation:

    この回答は役に立ちましたか?

    0 件のコメント コメントはありません

お客様の回答

質問作成者は回答に "承認済み"、モデレーターは "推奨" とマークできます。これにより、ユーザーは作成者の問題が回答によって解決したことを把握できます。