Background and Objective:
I am building an AI Agent in Azure AI Foundry which needs to invoke an Azure Function dynamically during conversations.
Example Scenario: A user asks about weather information → the agent triggers an Azure Function ("GetWeather") → the function processes the request and returns results.
This example is simplified but meant to understand the full production-grade process of connecting Azure Functions as callable tools inside AI Foundry Agents.
Steps Taken:
Using the Python SDK (azure-ai-projects
), I tried defining an agent with a tool of type azure_function
.
The tool definition binds the Azure Function via Storage Queue input and output bindings (no HTTP trigger for now).
Attempted agent creation with this tool specified.
Problem Encountered:
While creating the agent, I get this error:
azure.core.exceptions.HttpResponseError: (None) Invalid tool value(s): azure_function
Code: None
Message: Invalid tool value(s): azure_function
This suggests that azure_function tool type is not directly accepted unless further setup is done.
Investigation and Current Understanding:
From documentation and forums, I learned about Capability Hosts, a new experimental concept in Azure ML and AI Foundry:
Capability Hosts seem to act as a bridge layer, allowing agents to interact with external resources like Functions, Storage, Databases, etc.
It is mentioned that certain tools like azure_function
, storage_blob
, etc., require an active Capability Host.
I attempted to create a Capability Host using the CLI (az ml capability-host create
) but ran into YAML validation errors (specifically around connections
field not being recognized).
Structured Questions Needing Clarification:
- High-Level Flow
What is the full end-to-end process required to enable an AI Foundry Agent to invoke an Azure Function? (From agent creation, linking external resources, to actual runtime invocation)
- Necessity of Capability Host
Is creating a Capability Host mandatory to allow an agent to use a tool of type azure_function
?
If yes, what components need to be part of a Capability Host?
If no, is there an alternative simpler mechanism when using Storage Queue-based bindings only?
- Role and Significance of Capability Host
What exactly does a Capability Host do?
Does it merely act as a credential and connection broker?
Does it also route execution requests dynamically to registered resources?
- Correct Capability Host Definition
What is the correct YAML structure to create a Capability Host that supports Azure Function tool execution? (Especially since the error I encountered suggests my YAML is invalid around connections
field)
Example of error faced:
Validation for CapabilityHostSchema failed:
{
"connections": [
"Unknown field."
]
}
My original capabilityhost.yml
:
name: mg-voice-agent-capability-host
description: Capability host for MG AI voice agent project
connections:
ai_services_connections:
- mgaiagentshub17057533407_aoai
storage_connections:
- MG-AI-AGENTS-PROJECT-1/workspaceblobstore
- Portal / UI Options
Is there a way to create and manage Capability Hosts via the Azure Portal or Azure ML Studio interface instead of CLI and YAML? (If yes, where exactly?)
✅ Summary: I want to create an AI agent that can call an Azure Function, understand whether Capability Host is mandatory, how to correctly define and configure it and how the agent-resource interaction is established.