Provision Foundry Toolbox
Create a new Azure AI Search index from local text documents, then create an
immutable Foundry Toolbox version that exposes the index as
azure_ai_search. Always use the Foundry project in
AZURE_VOICE_AGENTS_ENDPOINT.
Use the bundled provisioner. It uses
the supported azure-ai-projects Toolbox client and discovers the project's
Azure AI Search connection. It does not reuse the Foundry IQ URL or connection.
Prerequisites
- Run from the
VoiceAgentdirectory with its Python environment active. - Install
samples/requirements.txt. - Sign in with
az loginusing an identity that can read the Foundry project, create Search indexes, upload documents, and create Toolbox versions. - Set
AZURE_VOICE_AGENTS_ENDPOINTinsamples/.env. - The Foundry project must contain an Azure AI Search connection.
Workflow
Resolve the document folder. Default to
samples/sample_foundry_iq_doc.Choose one new lowercase, hyphenated Toolbox name. Add a short unique suffix when the user does not provide a name. Reuse the same name in preflight and creation.
Run the read-only preflight:
python skills/provision-foundry-toolbox/scripts/provision_foundry_toolbox.py --name <name> --dry-runConfirm that the plan points to the endpoint project, intended Search connection, correct document count, a new Search index, and a new Toolbox.
Create and validate the index and Toolbox version:
python skills/provision-foundry-toolbox/scripts/provision_foundry_toolbox.py --name <name>For another folder, pass
--docs-dir <path>. If the project has multiple Search connections, pass--search-connection-name <name>.Return the final two output lines to the user:
AZURE_VOICE_AGENTS_TOOLBOX_NAME=<toolbox-name> AZURE_VOICE_AGENTS_TOOLBOX_VERSION=<immutable-version>Add
--update-envonly when the user asks to replace the Toolbox values insamples/.env.
Behavior and safety
- A normal invocation creates a dedicated Azure AI Search index and a Foundry
Toolbox version. Run
--dry-runfirst. - The provisioner supports UTF-8 Markdown, text, JSON, and HTML files. It
chunks each file and creates a lexical index queried with
query_type=simple. - Require a new Toolbox and index name. Do not overwrite or delete existing Toolbox versions, indexes, connections, or documents.
- Never print access tokens or connection credentials.
- On failure, report the failed Search or Toolbox operation. Leave existing
.envvalues unchanged unless--update-envwas explicitly supplied and creation completed successfully.