メモ
Azure AI 検索は、Azure ポータル、REST API、およびAzure SDKから使用できます。 また、Foundry IQ は、エンタープライズ コンテンツを、Microsoft Foundry ポータルのエージェントの再利用可能なアクセス許可に対応したナレッジ ベースに変換するマネージド ナレッジ レイヤーです。
メモ
このエージェント検索機能は、プログラムによるアクセスを介して 2026-04-01 REST API で一般提供されています。 Azure ポータルと foundry ポータルMicrosoftは、引き続きすべてのエージェント検索機能へのプレビュー専用アクセスを提供します。 移行のガイダンスについては、「 エージェントの取得コードを最新バージョンに移行する」を参照してください。
プレビュー REST API を使用する場合は、この機能ではまだ一般公開されていない機能にアクセスできます。 プレビュー機能は、サービス レベル アグリーメントなしで提供され、運用環境のワークロードには推奨されません。 詳細については、「 Microsoft Azure プレビューの追加使用条件」を参照してください。
重要
これらの機能は、2026-05-01-preview REST API の一部です。 2026-05-01-preview は、お客様の Azure サブスクリプションの一部としてお客様にライセンス供与されるものであり、Microsoft Product Terms における「Previews」に適用される条件、Microsoft Products and Services Data Protection Addendum(「DPA」)、および Supplemental Terms of Use for Microsoft Azure Previews に従うものとします。
2026-05-01-preview では、他のMicrosoft サービスやサード パーティのサービスへの接続がサポートされています。 これらのサービスの利用は各サービスの利用規約に従うものとし、データが Azure コンプライアンス境界の外部で処理または保存されたり、Azure コンプライアンス境界内に流入したりする場合があります。
データが組織のコンプライアンスと地理的境界の外部に流れるかどうか、および関連する影響、および適切なアクセス許可、境界、承認がプロビジョニングされるかどうかを管理するのは、お客様の責任です。
特定のユース ケースのコンテキストで構築したアプリケーションを慎重に確認およびテストし、すべての適切な決定とカスタマイズを行う責任があります。 これには、メタプロンプト、コンテンツ フィルター、その他の安全システムなどの独自の責任ある AI 軽減策の実装や、アプリケーションが適切な品質、信頼性、セキュリティ、信頼性の標準を満たしていることを確認する機能が含まれます。 詳細については、「Azure AI 検索透過性に関するメモを参照してください。
重要
Web ナレッジ ソースは、Grounding with Bing Search または Grounding with Bing Custom Search を利用するファーストパーティ消費サービスです。これには、「Grounding with Bing」の利用規約および Microsoft のプライバシー ステートメントが適用されます。
Microsoft Data Protection 補遺は、Web ナレッジ ソースに送信されるデータには適用されません。 顧客が Web ナレッジ ソースを使用する場合、顧客データはAzureコンプライアンスと地理的境界の外側に流れます。 これは、Web ナレッジ ソースを使用することで、該当する場合、データ主権および審査済み/市民権に基づくサポートを含む、すべての高度な政府コミュニティ クラウドのセキュリティおよびコンプライアンスのコミットメントを免除することを意味します。
Web ナレッジ ソースの使用にはコストが発生します。 価格の詳細については、こちらをご覧ください。
Azure管理者がWeb ナレッジ ソースの使用へのアクセスを管理する方法について詳しく学びましょう。
Web Knowledge Source を使用すると、エージェント検索パイプライン内のMicrosoft Bingからリアルタイム Web データを取得できます。 ナレッジ ソース は個別に作成され、 ナレッジ ベースで参照され、実行時にナレッジ ベースの クエリが実行されるときに、グラウンド データとして使用されます。
Bingカスタム検索は、常に Web ナレッジ ソースの検索プロバイダーです。 代替の検索プロバイダーやエンジンを指定することはできませんが、など、特定https://learn.microsoft.com含めたり除外したりすることはできます。 ドメインが指定されていない場合、Web ナレッジ ソースはパブリック インターネット全体に無制限にアクセスできます。
Web ナレッジ ソースは、他のナレッジ ソースと共に最適に機能します。 独自のコンテンツが完全な up-to-date 回答を提供しない場合、または商用検索エンジンからの情報で結果を補足する場合に使用します。
利用サポート
| Azure Portal | Microsoft Foundry ポータル | .NET SDK | Python SDK | Java SDK | JavaScript SDK | REST API |
|---|---|---|---|---|---|---|
| ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
前提 条件
Azure サブスクリプションでWeb Knowledge Sourceへのアクセスが可能であること。 既定では、アクセスは有効になっています。 アクセスが無効になっている場合は、管理者に問い合わせてください。
任意のパブリック リージョン内でエージェントリトリーバルを提供するAzure AI 検索 サービス。 Web ナレッジ ソースは、プライベート クラウドまたはソブリン クラウドではサポートされていません。
ナレッジソースを作成する権限。 ユーザー アカウントに割り当てられた Search Service 共同作成者ロール (推奨) を使用してキーレス認証を構成するか、API キーを使用します。
必須
Azure.Search.Documentsパッケージ:2026-05-01-preview 機能の場合、最新のプレビュー パッケージ:
dotnet add package Azure.Search.Documents --prerelease2026-04-01 機能の場合、最新の安定したパッケージ:
dotnet add package Azure.Search.Documents
必須
azure-search-documentsパッケージ:2026-05-01-preview 機能の場合、最新のプレビュー パッケージ:
pip install --pre azure-search-documents2026-04-01 機能の場合、最新の安定したパッケージ:
pip install azure-search-documents
必要な REST API バージョン:
プレビュー機能の場合: Search Service 2026-05-01-preview
一般公開されている機能の場合: Search Service 2026-04-01
制限事項と考慮事項
Web コンテンツは、取得結果に含まれる前に LLM によって常に要約されます。 結果は、逐語的な Web テキストではなく、要約として引用されます。
2026-04-01 API バージョンの場合、ナレッジ ベースには、Web コンテンツの要約用の LLM を提供するためのモデル参照が含まれている必要があります。 情報取得は常に抽出形式のものです (引用された要約)。 応答合成と構成可能な推論作業は、このバージョンでは使用できません。
2026-05-01-preview API バージョンの場合、ナレッジ ベース モデル リファレンスでは、抽出された引用の代わりに単一の LLM で作成された応答を生成する 回答合成も可能になります。
既存のナレッジ ソースを確認する
ナレッジ ソースは、最上位の再利用可能なオブジェクトです。 既存のナレッジ ソースについて知ることは、新しいオブジェクトを再利用または名前付けする場合に役立ちます。
次のコードを実行して、名前と種類でナレッジ ソースを一覧表示します。
// List knowledge sources by name and type
using Azure.Search.Documents.Indexes;
var indexClient = new SearchIndexClient(new Uri(searchEndpoint), credential);
var knowledgeSources = indexClient.GetKnowledgeSourcesAsync();
Console.WriteLine("Knowledge Sources:");
await foreach (var ks in knowledgeSources)
{
Console.WriteLine($" Name: {ks.Name}, Type: {ks.GetType().Name}");
}
Reference:SearchIndexClient
# List knowledge sources by name and type
from azure.core.credentials import AzureKeyCredential
from azure.search.documents.indexes import SearchIndexClient
index_client = SearchIndexClient(endpoint = "search_url", credential = AzureKeyCredential("api_key"))
for ks in index_client.list_knowledge_sources():
print(f" - {ks.name} ({ks.kind})")
Reference:SearchIndexClient
### List knowledge sources by name and type
GET {{search-url}}/knowledgesources?api-version={{api-version}}&$select=name,kind
Authorization: Bearer {{token}}
リファレンス:ナレッジ ソース - リスト
名前で 1 つのナレッジ ソースを返して、その JSON 定義を確認することもできます。
using Azure.Search.Documents.Indexes;
using System.Text.Json;
var indexClient = new SearchIndexClient(new Uri(searchEndpoint), credential);
// Specify the knowledge source name to retrieve
string ksNameToGet = "earth-knowledge-source";
// Get its definition
var knowledgeSourceResponse = await indexClient.GetKnowledgeSourceAsync(ksNameToGet);
var ks = knowledgeSourceResponse.Value;
// Serialize to JSON for display
var jsonOptions = new JsonSerializerOptions
{
WriteIndented = true,
DefaultIgnoreCondition = System.Text.Json.Serialization.JsonIgnoreCondition.Never
};
Console.WriteLine(JsonSerializer.Serialize(ks, ks.GetType(), jsonOptions));
Reference:SearchIndexClient
# Get a knowledge source definition
from azure.core.credentials import AzureKeyCredential
from azure.search.documents.indexes import SearchIndexClient
import json
index_client = SearchIndexClient(endpoint = "search_url", credential = AzureKeyCredential("api_key"))
ks = index_client.get_knowledge_source("knowledge_source_name")
print(json.dumps(ks.as_dict(), indent = 2))
Reference:SearchIndexClient
### Get a knowledge source definition
GET {{search-url}}/knowledgesources/{{knowledge-source-name}}?api-version={{api-version}}
Authorization: Bearer {{token}}
リファレンス:ナレッジ ソース - 取得
次の JSON は、Web ナレッジ ソース リソースの応答の例です。
{
"name": "my-web-ks",
"kind": "web",
"description": "A sample Web Knowledge Source.",
"encryptionKey": null,
"webParameters": {
"domains": null
}
}
ナレッジ ソースを作成する
次のコードを実行して、Web ナレッジ ソースを作成します。
// Create Web Knowledge Source
using Azure.Search.Documents.Indexes;
using Azure.Search.Documents.Indexes.Models;
using Azure;
var indexClient = new SearchIndexClient(new Uri(searchEndpoint), new AzureKeyCredential(apiKey));
var knowledgeSource = new WebKnowledgeSource(name: "my-web-ks")
{
Description = "A sample Web Knowledge Source.",
WebParameters = new WebKnowledgeSourceParameters
{
Domains = new WebKnowledgeSourceDomains
{
AllowedDomains =
{
new WebKnowledgeSourceDomain(address: "learn.microsoft.com") { IncludeSubpages = true }
},
BlockedDomains =
{
new WebKnowledgeSourceDomain(address: "bing.com") { IncludeSubpages = false }
}
}
}
};
await indexClient.CreateOrUpdateKnowledgeSourceAsync(knowledgeSource);
Console.WriteLine($"Knowledge source '{knowledgeSource.Name}' created or updated successfully.");
Reference:SearchIndexClient、 WebKnowledgeSource
# Create Web Knowledge Source
from azure.core.credentials import AzureKeyCredential
from azure.search.documents.indexes import SearchIndexClient
from azure.search.documents.indexes.models import WebKnowledgeSource, WebKnowledgeSourceParameters, WebKnowledgeSourceDomains, WebKnowledgeSourceDomain
index_client = SearchIndexClient(endpoint = "search_url", credential = AzureKeyCredential("api_key"))
knowledge_source = WebKnowledgeSource(
name = "my-web-ks",
description = "A sample Web Knowledge Source.",
encryption_key = None,
web_parameters = WebKnowledgeSourceParameters(
domains = WebKnowledgeSourceDomains(
allowed_domains = [ WebKnowledgeSourceDomain(address="learn.microsoft.com", include_subpages=True) ],
blocked_domains = [ WebKnowledgeSourceDomain(address="bing.com", include_subpages=False) ]
)
)
)
index_client.create_or_update_knowledge_source(knowledge_source)
print(f"Knowledge source '{knowledge_source.name}' created or updated successfully.")
Reference:SearchIndexClient
### Create Web Knowledge Source
PUT {{search-url}}/knowledgesources/my-web-ks?api-version=2026-05-01-preview
Content-Type: application/json
api-key: {{api-key}}
{
"name": "my-web-ks",
"kind": "web",
"description": "This knowledge source pulls content from the web.",
"encryptionKey": null,
"webParameters": {
"domains": {
"allowedDomains": [ { "address": "learn.microsoft.com", "includeSubpages": true } ],
"blockedDomains": [ { "address": "bing.com", "includeSubpages": false } ]
}
}
}
リファレンス:ナレッジ ソース - 作成または更新
ナレッジ ベースに割り当てる
ナレッジ ソースに満足している場合は、 ナレッジ ベースに追加します。
ナレッジ ベースのクエリを実行する
Web ナレッジ ソースを含むナレッジ ベースに対してクエリを実行すると、配列 activity 取得応答に 2 つの Web 関連レコードを含めることができます。
- 要求に使用されるランタイム パラメーターをキャプチャする
webレコード。 - LLM 要約ステップのトークン使用状況をキャプチャする
modelWebSummarizationレコード。
{
"activity": [
{
"id": 1,
"type": "web",
"knowledgeSourceName": "my-web-ks",
"elapsedMs": 212,
"webArguments": {
"search": "What is the latest news about AI in education?",
"language": "en",
"market": "en-US",
"count": 10,
"freshness": "2026-03-01..2026-03-31"
}
},
{
"id": 2,
"type": "modelWebSummarization",
"elapsedMs": 87,
"inputTokens": 1234,
"outputTokens": 256
}
]
}
ナレッジ ソースを削除する
ナレッジ ソースを削除する前に、ナレッジ ソースを参照するすべてのナレッジ ベースを削除するか、ナレッジ ベース定義を更新して参照を削除する必要があります。 インデックスとインデクサー パイプラインを生成するナレッジ ソースの場合、 生成されたすべてのオブジェクト も削除されます。 ただし、既存のインデックスを使用してナレッジ ソースを作成した場合、インデックスは削除されません。
使用中のナレッジ ソースを削除しようとすると、アクションは失敗し、影響を受けるナレッジ ベースの一覧が返されます。
ナレッジ ソースを削除するには:
検索サービスのすべてのナレッジ ベースの一覧を取得します。
using Azure.Search.Documents.Indexes; var indexClient = new SearchIndexClient(new Uri(searchEndpoint), credential); var knowledgeBases = indexClient.GetKnowledgeBasesAsync(); Console.WriteLine("Knowledge Bases:"); await foreach (var kb in knowledgeBases) { Console.WriteLine($" - {kb.Name}"); }Reference:SearchIndexClient
応答の例は次のようになります。
{ "@odata.context": "https://my-search-service.search.windows.net/$metadata#knowledgebases(name)", "value": [ { "name": "my-kb" }, { "name": "my-kb-2" } ] }個別のナレッジベース定義を取得して、ナレッジソースの参照を確認する。
using Azure.Search.Documents.Indexes; using System.Text.Json; var indexClient = new SearchIndexClient(new Uri(searchEndpoint), credential); // Specify the knowledge base name to retrieve string kbNameToGet = "earth-knowledge-base"; // Get a specific knowledge base definition var knowledgeBaseResponse = await indexClient.GetKnowledgeBaseAsync(kbNameToGet); var kb = knowledgeBaseResponse.Value; // Serialize to JSON for display string json = JsonSerializer.Serialize(kb, new JsonSerializerOptions { WriteIndented = true }); Console.WriteLine(json);Reference:SearchIndexClient
応答の例は次のようになります。
{ "Name": "earth-knowledge-base", "KnowledgeSources": [ { "Name": "earth-knowledge-source" } ], "Models": [ {} ], "RetrievalReasoningEffort": {}, "OutputMode": {}, "ETag": "\u00220x8DE278629D782B3\u0022", "EncryptionKey": null, "Description": null, "RetrievalInstructions": null, "AnswerInstructions": null }ナレッジ ベースを削除するか、複数のナレッジ ソースがある場合は、ナレッジ ベースを更新してソースを削除します。 この例では、削除を示します。
using Azure.Search.Documents.Indexes; var indexClient = new SearchIndexClient(new Uri(searchEndpoint), credential); await indexClient.DeleteKnowledgeBaseAsync(knowledgeBaseName); System.Console.WriteLine($"Knowledge base '{knowledgeBaseName}' deleted successfully.");Reference:SearchIndexClient
ナレッジ ソースを削除します。
await indexClient.DeleteKnowledgeSourceAsync(knowledgeSourceName); System.Console.WriteLine($"Knowledge source '{knowledgeSourceName}' deleted successfully.");Reference:SearchIndexClient
検索サービスのすべてのナレッジ ベースの一覧を取得します。
# Get knowledge bases from azure.core.credentials import AzureKeyCredential from azure.search.documents.indexes import SearchIndexClient index_client = SearchIndexClient(endpoint = "search_url", credential = AzureKeyCredential("api_key")) print("Knowledge Bases:") for kb in index_client.list_knowledge_bases(): print(f" - {kb.name}")Reference:SearchIndexClient
応答の例は次のようになります。
{ "@odata.context": "https://my-search-service.search.windows.net/$metadata#knowledgebases(name)", "value": [ { "name": "my-kb" }, { "name": "my-kb-2" } ] }個別のナレッジベース定義を取得して、ナレッジソースの参照を確認する。
# Get a knowledge base definition from azure.core.credentials import AzureKeyCredential from azure.search.documents.indexes import SearchIndexClient index_client = SearchIndexClient(endpoint = "search_url", credential = AzureKeyCredential("api_key")) kb = index_client.get_knowledge_base("knowledge_base_name") print(kb)Reference:SearchIndexClient
応答の例は次のようになります。
{ "name": "my-kb", "description": null, "retrievalInstructions": null, "answerInstructions": null, "outputMode": null, "knowledgeSources": [ { "name": "my-blob-ks" } ], "models": [], "encryptionKey": null, "retrievalReasoningEffort": { "kind": "low" } }ナレッジ ベースを削除するか、複数のナレッジ ソースがある場合は、ナレッジ ベースを更新してソースを削除します。 この例では、削除を示します。
# Delete a knowledge base from azure.core.credentials import AzureKeyCredential from azure.search.documents.indexes import SearchIndexClient index_client = SearchIndexClient(endpoint = "search_url", credential = AzureKeyCredential("api_key")) index_client.delete_knowledge_base("knowledge_base_name") print(f"Knowledge base deleted successfully.")Reference:SearchIndexClient
ナレッジ ソースを削除します。
# Delete a knowledge source from azure.core.credentials import AzureKeyCredential from azure.search.documents.indexes import SearchIndexClient index_client = SearchIndexClient(endpoint = "search_url", credential = AzureKeyCredential("api_key")) index_client.delete_knowledge_source("knowledge_source_name") print(f"Knowledge source deleted successfully.")Reference:SearchIndexClient
検索サービスのすべてのナレッジ ベースの一覧を取得します。
### Get knowledge bases GET {{search-url}}/knowledgebases?api-version={{api-version}}&$select=name Authorization: Bearer {{token}}リファレンス:ナレッジ ベース - リスト
応答の例は次のようになります。
{ "@odata.context": "https://my-search-service.search.windows.net/$metadata#knowledgebases(name)", "value": [ { "name": "my-kb" }, { "name": "my-kb-2" } ] }個別のナレッジベース定義を取得して、ナレッジソースの参照を確認する。
### Get a knowledge base definition GET {{search-url}}/knowledgebases/{{knowledge-base-name}}?api-version={{api-version}} Authorization: Bearer {{token}}リファレンス:ナレッジ ベース - 取得
応答の例は次のようになります。
{ "name": "my-kb", "description": null, "retrievalInstructions": null, "answerInstructions": null, "outputMode": null, "knowledgeSources": [ { "name": "my-blob-ks" } ], "models": [], "encryptionKey": null, "retrievalReasoningEffort": { "kind": "low" } }ナレッジ ベースを削除するか、複数のナレッジ ソースがある場合は、ナレッジ ベースを更新してソースを削除します。 この例では、削除を示します。
### Delete a knowledge base DELETE {{search-url}}/knowledgebases/{{knowledge-base-name}}?api-version={{api-version}} Authorization: Bearer {{token}}リファレンス:ナレッジ ベース - 削除
ナレッジ ソースを削除します。
### Delete a knowledge source DELETE {{search-url}}/knowledgesources/{{knowledge-source-name}}?api-version={{api-version}} Authorization: Bearer {{token}}リファレンス:ナレッジ ソース - 削除