microsoft/semantic-kernel · error · NotImplementedError
Azure Function tools are not yet supported with the Azure AI
Error message
Azure Function tools are not yet supported with the Azure AI Agent Declarative Spec.
What it means
Raised as NotImplementedError when a declarative spec references a tool of type azure_function. Azure Function tool binding for the Azure AI Agent Declarative Spec is not yet implemented (tracked TODO evmattso).
Source
Thrown at python/semantic_kernel/agents/azure_ai/azure_ai_agent.py:139
filter_expr = opts.get("filter", "")
top_k = opts.get("top_k", 5)
if not isinstance(top_k, int):
raise AgentInitializationException(f"'top_k' must be an integer in: {spec}")
return AzureAISearchTool(
index_connection_id=conn_id,
index_name=index_name,
query_type=query_type,
filter=filter_expr,
top_k=top_k,
)
@_register_tool("azure_function")
def _azure_function(spec: ToolSpec) -> ToolDefinition:
# TODO(evmattso): Implement Azure Function tool support
raise NotImplementedError("Azure Function tools are not yet supported with the Azure AI Agent Declarative Spec.")
@_register_tool("bing_grounding")
def _bing_grounding(spec: ToolSpec) -> BingGroundingTool:
opts = spec.options or {}
connections = spec.options.get("tool_connections")
if not connections or not isinstance(connections, list) or not connections[0]:
raise AgentInitializationException(f"Missing or malformed 'tool_connections' in: {spec}")
conn_id = connections[0]
market = opts.get("market", "")
set_lang = opts.get("set_lang", "")
count = opts.get("count", 5)
if not isinstance(count, int):
raise AgentInitializationException(f"'count' must be an integer in: {spec}")
freshness = opts.get("freshness", "")
View on GitHub (pinned to c028a0c7dc)
Solutions
- Remove the azure_function tool from the declarative spec until the feature ships.
- Use a kernel function tool (type: function) that calls the Azure Function via the Functions client as a workaround.
- Track the SDK changelog for Azure Function tool support in the declarative spec builder.
Example fix
// before
tools:
- type: azure_function
options: {...}
// after
# remove it, or wrap the function call in a kernel function
tools:
- type: function
id: MyPlugin-CallAzureFunc Defensive patterns
Strategy: try-catch
Validate before calling
SUPPORTED_TOOL_TYPES = {"azure_ai_search", "bing_grounding", "code_interpreter", "file_search", "function", "openapi"}
def filter_unsupported(tools: list[dict]) -> list[dict]:
return [t for t in tools if t.get("type") in SUPPORTED_TOOL_TYPES] Type guard
def is_supported_tool_type(t: str) -> bool:
return t in {"azure_ai_search", "bing_grounding", "code_interpreter", "file_search", "function", "openapi"} Try / catch
try:
agent = AzureAIAgent.from_yaml(spec)
except NotImplementedError as e:
if "azure_function" in str(e):
spec = strip_tool_type(spec, "azure_function")
agent = AzureAIAgent.from_yaml(spec)
raise Prevention
- Strip azure_function tool entries before passing specs until the SDK ships support.
- Subscribe to the SDK release notes for Azure Function declarative tool support.
When it happens
Trigger: Including a tool entry with type: azure_function in the declarative agent spec.
Common situations: Developer follows Azure docs that mention Azure Function tools and assumes SDK support; copies a spec from a roadmap or preview sample.
Related errors
- Missing or malformed 'tool_connections' in: {spec}
- Missing or malformed 'index_name' in: {spec}
- Invalid query_type '{raw_query_type}' in: {spec}
- 'top_k' must be an integer in: {spec}
- 'count' must be an integer in: {spec}
AI-assisted analysis of microsoft/semantic-kernel@c028a0c7dc (2026-08-13).
Data as JSON: /api/errors/b4b3bcba7124da94.
Report an issue: GitHub.