a2018b40f9
* Require approvals for file-access and expose auto approval funcs for it * Scope file-access auto-approval rules to local tools; fix base-Agent sample Address PR #6599 review feedback: - read_only/all_tools auto-approval rules now reject any call carrying a server_label so they stay scoped to FileAccessProvider's local tools and never auto-approve a same-named hosted tool. - Expand the FileAccessProvider docstring to explain the runtime effect of approval_mode="always_require" and point to ToolApprovalMiddleware / create_harness_agent. - Fix the base-Agent file_access_data_processing sample, which would otherwise stop executing file tools under the new always_require defaults, by adding ToolApprovalMiddleware with all_tools_auto_approval_rule. - Add tests covering hosted (server_label) calls and update docs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Clean up comments * Update sample after merge --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Context Provider Samples
These samples demonstrate how to use context providers to enrich agent conversations with external knowledge — from custom logic to Azure AI Search (RAG) and memory services.
Samples
| File / Folder | Description |
|---|---|
simple_context_provider.py |
Implement a custom context provider by extending ContextProvider to extract and inject structured user information across turns. |
azure_ai_foundry_memory.py |
Use FoundryMemoryProvider to add semantic memory — automatically retrieves, searches, and stores memories via Azure AI Foundry. |
file_access_data_processing/ |
Use FileAccessProvider with FileSystemAgentFileStore to give an agent read/write/search access to a folder of CSV data files. See its own README. |
azure_ai_search/ |
Retrieval Augmented Generation (RAG) with Azure AI Search in semantic and agentic modes. See its own README. |
mem0/ |
Memory-powered context using the Mem0 integration (open-source and managed). See its own README. |
redis/ |
Redis-backed context providers for conversation memory and sessions. See its own README. |
Prerequisites
For simple_context_provider.py:
FOUNDRY_PROJECT_ENDPOINT: Your Azure AI Foundry project endpointFOUNDRY_MODEL: Model deployment name- Azure CLI authentication (
az login)
For azure_ai_foundry_memory.py:
FOUNDRY_PROJECT_ENDPOINT: Your Azure AI Foundry project endpointFOUNDRY_MODEL: Chat/responses model deployment nameAZURE_OPENAI_EMBEDDING_DEPLOYMENT_NAME: Embedding model deployment name (e.g.,text-embedding-ada-002)- Azure CLI authentication (
az login)
For file_access_data_processing/:
FOUNDRY_PROJECT_ENDPOINT: Your Azure AI Foundry project endpointFOUNDRY_MODEL: Chat model deployment name- Azure CLI authentication (
az login)
See each subfolder's README for provider-specific prerequisites.