Error "Function not found" when using custom functions in AI Agent lab

James 120 Reputation points
2025-04-25T16:51:16.1366667+00:00

Issue: I'm getting "Function 'submit_support_ticket' not found" errors when attempting the custom functions lab at https://microsoftlearning.github.io/mslearn-ai-agents/Instructions/03-agent-custom-functions.html

Error:


ERROR:root:Error executing function 'submit_support_ticket': Function 'submit_support_ticket' not found.

Code Snippet: user_functions.py


# In user_functions.py
def submit_support_ticket(email_address: str, description: str) -> str:
    # Function implementation...
    return message_json
# Simple set with no type annotation
user_functions = {submit_support_ticket}
# In agent.py
from user_functions import submit_support_ticket
# Create tools
functions = FunctionTool({submit_support_ticket})
toolset = ToolSet()
toolset.add(functions)
# Create agent with tools
agent = project_client.agents.create_agent(
    model=MODEL_DEPLOYMENT,
    name="support-agent",
    instructions="You are a technical support agent...",
    toolset=toolset
)

I'm following the instructions in Lab 03 for AI Agent custom functions and consistently receive "Function 'submit_support_ticket' not found" errors when the agent attempts to use the function.

I've verified my code matches the lab and tried multiple approaches to register the function. I'm using azure-ai-projects 1.0.0b10. Is there a known issue with function registration in this version or a specific syntax required beyond what's in the lab instructions?

Any help is appreciated, thank you!

Azure Training
Azure Training
Azure: A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.Training: Instruction to develop new skills.
2,395 questions
{count} votes

Accepted answer
  1. VarunTha 13,920 Reputation points Microsoft External Staff
    2025-05-02T19:46:20.0733333+00:00

    Hi James,

    Thank you for your patience.

    We have reached out to the content author and got a confirmation saying that they had fixed the issue.

    Please Accept the Answer & Upvote so that it will be useful for others in the community.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.