Learn how to build a smart task management assistant using Microsoft's Agentic AI Framework, Azure OpenAI, and Clean Architecture principles.

What is Agentic AI?

Traditional chatbots just respond to what you say. Agentic AI goes further—it thinks, plans, and acts autonomously. Instead of you telling it exactly what to do, you simply describe what you want, and the agent figures out the best way to help you.

The Microsoft Agentic AI Framework makes this easy by letting AI agents:

Why This Matters

In this guide, we built a Task Agent that helps you manage your to-do list through natural conversation. You can say things like:

The agent understands your intent, calls the right functions, and presents results beautifully with tables and smart suggestions.

What You'll Learn

  1. How to set up Azure OpenAI and deploy a model

  2. How to create function tools that agents can call automatically

  3. How to design effective agent instructions for better UX

  4. How to integrate agents into a Clean Architecture web application

  5. Best practices for presentation and contextual suggestions

Azure OpenAI Setup

Creating an Azure OpenAI Resource

Azure OpenAI provides enterprise-grade hosting for OpenAI's powerful language models with enhanced security, compliance, and regional availability.

Step 1. Access Azure Portal

  1. Navigate to Azure Portal

  2. Sign in with your Azure account

Step 2. Create the Resource

  1. Click "Create a resource" or use the search bar to find "Azure OpenAI"

  2. Select Azure OpenAI from Microsoft

  3. Click Create

Step 3. Configure Basic Settings

Fill in the required fields:

1

Step 4. Review and Create

  1. Review your settings (leave the other tabs with the default)

  2. Click Create

  3. Click Go to resource when finished

2

Deploying a Model

After creating your Azure OpenAI resource, you need to deploy a model to use it.

Step 1. Navigate to Azure AI Foundry

In your Azure OpenAI resource, click Go to Azure AI Foundry portal.

3

Step 2. Create a Deployment

Select Deployments from the left menu.

4

Click + Create new deployment.

5

Configure the deployment:

67

Click Create.

Getting Your Credentials

Step 1. Access Keys and Endpoint

  1. Return to Azure Portal

  2. Navigate to your Azure OpenAI resource

  3. Click Keys and Endpoint in the left menu

8

Step 2. Copy Required Values

You'll need three values:

Once you have created and deployed the OpenAI model, you can use the API Keys in the .NET project. Clone it here.

Understanding the Framework

How It Works

When you send a message to the agent:

  1. Agent receives your message + conversation history

  2. LLM analyzes what you want and which tools it needs

  3. Framework calls the selected functions automatically

  4. Results go back to the LLM

  5. Agent responds with natural language and formatted output

You don't write routing logic—the agent decides everything.

Key Concepts

AI Agent: The brain of your application

AIAgent agent = chatClient.CreateAIAgent(
    instructions: "You are Task Agent, a task management assistant.",
    tools: [createTaskTool, listTasksTool, updateTaskTool]);

Function Tools: C# methods the agent can call

[Description("Create a new task")]
public async Task<string> CreateTask(
    [Description("Task title")] string title,
    [Description("Priority: Low, Medium, High")] string priority = "Medium")
{
    // Your business logic here
}

Threads: Conversation sessions with memory

var thread = agent.GetNewThread();
await agent.RunAsync("Create a task", thread);
await agent.RunAsync("Show me all tasks", thread); // Remembers context

Building the Task Agent

The Architecture

We use Clean Architecture with 4 layers:

Domain (Core Business Logic)
   ↑
Application (Use Cases & Interfaces)
   ↑
Infrastructure (Data Access)
   ↑
Presentation (Web UI & Controllers

This keeps the AI agent separate from the database, making it easy to test and maintain.

Creating Function Tools

Our Task Agent has 6 tools that cover full CRUD operations:

  1. CreateTask - Creates new tasks

  2. ListTasks - Shows all tasks (with optional filters)

  3. GetTaskDetails - Gets info about a specific task

  4. UpdateTask - Changes task status or priority

  5. DeleteTask - Removes tasks

  6. GetTaskSummary - Shows statistics

Key Points

Designing Agent Instructions

This is where the magic happens. Good instructions make the difference between an OK agent and a great one.

What We Tell Our Agent:

  1. Who you are: "You are Task Agent, a professional task management assistant"

  2. What you can do: List all capabilities clearly

  3. How to behave

    • Act immediately when users give clear instructions

    • Don't ask for confirmation unnecessarily

    • Be direct and action-oriented

  4. How to present information:

    • Always use Markdown tables for listing 2+ tasks

    • Use emojis for status (⏳ Pending, 🔄 InProgress, ✅ Completed)

    • Use emojis for priority (🟢 Low, 🟡 Medium, 🔴 High)

  5. Provide contextual suggestions:

    • After creating a task: "💡 Suggestions: • View all tasks • Create a follow-up"

    • After listing: "💡 Suggestions: • Filter by priority • Update oldest task"

    • After completing: "💡 Suggestions: • View remaining tasks • Get summary"

Example Interaction

Below are some screenshots demonstrating the usage of the Task Agent.

9101112

As you saw, you can practice the CRUD operations with the AI Agent.

Best Practices

Agent Design

Function Tools

Security

Performance

What's Next?

Now that you have a working Task Agent, you can:

  1. Add more features: Due dates, categories, attachments, search

  2. Improve intelligence: Analyze patterns, suggest priorities, detect blockers

  3. Integrate services: Connect to calendar, email, project management tools

  4. Deploy to Azure: Host on Azure App Service with CI/CD

  5. Add authentication: Integrate Azure AD or other identity providers

The beauty of Agentic AI is that adding new capabilities is easy—just create new function tools and update the instructions. The agent handles the rest!

Final Thoughts

The Microsoft Agentic AI Framework represents a significant leap forward in building intelligent applications. By abstracting the complexity of function calling, context management, and LLM integration, it enables developers to focus on business logic and user experience.