[ ABORT TO HUD ]
SEQ. 1
SEQ. 2
SEQ. 3

Creating Your First Agent

🤖 Building AI Agents 10 min 80 BASE XP

Building an Agent in 5 Minutes

Via the Foundry Portal

  1. Navigate to Agents in your project sidebar
  2. Click + New Agent
  3. Select a deployed model (e.g., gpt-4o)
  4. Write system instructions defining the agent's role
  5. Add tools (code interpreter, file search, custom functions)
  6. Test in the Agent Playground

Via the SDK (Python)

from azure.ai.projects import AIProjectClient
from azure.identity import DefaultAzureCredential

project = AIProjectClient(
    endpoint="<endpoint>",
    credential=DefaultAzureCredential()
)

agent = project.agents.create_agent(
    model="gpt-4o",
    name="Research Assistant",
    instructions="You are a research assistant. Search the web and summarize findings clearly.",
    tools=[{"type": "code_interpreter"}]
)

thread = project.agents.create_thread()
project.agents.create_message(
    thread_id=thread.id,
    role="user",
    content="Analyze the latest trends in renewable energy"
)

run = project.agents.create_and_process_run(
    thread_id=thread.id,
    agent_id=agent.id
)
messages = project.agents.list_messages(thread_id=thread.id)
print(messages.data[0].content[0].text.value)
🎯 Pro Tip: Write agent instructions as if briefing a new employee. Be specific about what the agent should and should NOT do, what tone to use, and how to handle edge cases.
FOUNDRY VERIFICATION
QUERY 1 // 1
What is the recommended approach for writing agent instructions?
Keep them as short as possible
Write them like briefing a new employee — specific about role, boundaries, and edge cases
Copy from documentation
Leave them empty and rely on the model
Watch: 139x Rust Speedup
Creating Your First Agent | Building AI Agents — Azure Foundry Academy