Repository navigation
Python: Correct Azure AI Search sample setup instructions - #9520
LI (ktz03) wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The documentation-only corrections match the existing implementation and samples, with no unresolved findings.
No open issues 🎉
What changed in this PR
Corrects Azure AI Search sample documentation to match the existing provider API and shipped examples. No runtime behavior changes.
Changes:
- Separates existing Knowledge Base and index-backed agentic setup.
- Corrects parameter names, defaults, authentication guidance, and sample commands.
- Fixes the semantic sample reference in the agentic sample’s explanatory text.
| File | Description |
|---|---|
python/samples/02-agents/context_providers/azure_ai_search/search_context_agentic.py |
Corrects a filename reference in explanatory text. |
python/samples/02-agents/context_providers/azure_ai_search/README.md |
Aligns setup instructions and examples with the current API. |
Review effort: Balanced
Eduard van Valkenburg (eavanvalkenburg)
left a comment
There was a problem hiding this comment.
The setup split and parameter corrections are otherwise sound, but the revised optional-key authentication path remains broken in the README examples.
| project_endpoint=project_endpoint, | ||
| model=model_deployment, | ||
| credential=DefaultAzureCredential(), | ||
| credential=AzureCliCredential(), |
There was a problem hiding this comment.
The README now says omitting AZURE_SEARCH_API_KEY uses AzureCliCredential, but this credential is only passed to the Foundry client. Both AzureAISearchContextProvider examples still pass api_key=search_key without a fallback credential, so construction raises when the key is absent. Please create/reuse an AzureCliCredential and pass it to the provider when no API key is configured, matching the shipped semantic and agentic samples.
Motivation & Context
The Azure AI Search sample guide combines mutually exclusive
index_nameandknowledge_base_namearguments in its agentic example, which raisesSettingNotFoundErrorduring construction. It also lists obsolete script names and constructor options.Description & Review Guide
SettingNotFoundError; documented argument names now match the current constructor. Ruff checks and source compilation pass on Windows with cached Azure Search SDK 12.0.0. No full sample, cloud retrieval, model, authentication, preview SDK, package build or full-suite run was performed.AzureAISearchContextProvider, and the documented commands name files that exist.Related Issue
N/A - trivial change. These are obvious documentation corrections to match existing public constructors and shipped sample names. Existing Knowledge Base support was added in #2464; this change preserves that behavior and the initialization/sample work in #5021 and #2369.
AI Assistance
AI assistance details: Documentation, example verification, and this PR description.
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.