I recently watched a Microsoft session about building agents with the Microsoft 365 Agents SDK and the Teams SDK. The talk was clear, but I wanted to know what it actually feels like to build something, so I picked a tiny use case and built it end to end. This article walks through everything I did, including the errors I hit, so you can follow along even if you're a beginner like me.

The small use case: a Status Helper
Here's what I decided to build:
In Teams, I type status and the agent replies with a card listing my tasks. Each open task has a Done button. I can also type add to open a small form and create a new task. The tasks live in a Dataverse table.
It covers the core ideas from the video: receiving messages, replying with adaptive cards, handling button clicks, using a Teams dialog, and storing data somewhere real.
I used JavaScript and the Microsoft 365 Agents SDK.
Step 1: Set up and run an echo agent first
Before building anything clever, I wanted to prove my setup worked. So I started with Microsoft's own echo agent, which simply repeats whatever you type.
What you need:
Node.js 22 or newer
Visual Studio Code
The setup was only a few commands:
mkdir status-helper
cd status-helper
npm init -y
npm install @microsoft/agents-hosting-express
I pasted the echo agent code into index.mjs and started it with node index.mjs. The terminal printed a line like "Server listening to port 3978...".
It looks like an error message, but it's actually the success message. The appId undefined part is normal when you run locally without authentication.
npm install -D @microsoft/teams-app-test-tool
npx teamsapptester
Lesson learned: you need two terminals. One runs the agent, the other runs the test tool. My first attempt failed with ECONNREFUSED 127.0.0.1:3978 because the agent wasn't running when the test tool tried to reach it.
Another small trap: when I later pasted my new code, the Playground still showed the old echo welcome message. I hadn't saved the file and restarted the agent. Node doesn't reload code on its own, so save, stop, start again, refresh the browser.
Step 2: Turn it into the Status Helper
With the setup proven, I replaced the echo logic with my own. The agent now:
• answers status with an adaptive card showing a list of tasks,
• understands done 1 (or any task number) and marks that task as done,
• replies with a friendly hint for anything else.
An adaptive card is just JSON that describes how a card should look. The agent builds the card from the task list and sends it as a reply.
Step 3: Add real buttons
Typing done 2 is fine for testing, but buttons are nicer. I added an Action.Execute button to the card for each open task.
The idea is simple:
1. Each button carries a verb (a label like completeTask) and some data (like the task ID).
2. The agent registers a handler for that verb.
3. When someone clicks the button, the handler marks the task done and returns a fresh card, which replaces the old one in place.
One detail worth knowing: buttons of this type need the card version set to 1.4.
Step 4: Moving into real Teams
The Playground is a simulator. I wanted to see the agent inside the real Teams app. Teams can't reach localhost on your computer, so you need a few extras: an app registration, a bot record, an app manifest, and a tunnel that gives your local server a public address. Doing that by hand is a lot for a beginner.
The Microsoft 365 Agents Toolkit (a VS Code extension) does it all for you. I installed it, signed in with my work account, and created a new project.
The wizard surprised me
The wizard offered several project types. For an Agents SDK project the right choice was Custom Engine Agent.

Then it asked me to choose an LLM service (Azure OpenAI or OpenAI) and offered two templates, a Basic Custom Engine Agent and a Weather Agent. Both are designed around a language model, so there's no plain "no AI" option.
I didn't want AI in this version, so I picked OpenAI and planned to replace the generated logic entirely. The generated project turned out to be a weather agent that uses LangChain, but I only needed its plumbing.

Step 5: Adding the Teams extension and a dialog
Now for the feature from the video I was most curious about: Teams-specific UI. I added the MS Teams extension (@microsoft/agents-hosting-extensions-msteams) and built a dialog, a popup form that opens on top of the chat.
The flow:
1. I type add. The agent replies with a small card holding an Open form button.
2. Clicking it asks the agent "what should the popup show?" The agent answers with a form card containing a task title field.
3. I type a title and click Add. The agent receives the text, creates the task and closes the popup.
One design choice: I put the "open form" button on its own card instead of mixing it with the Done buttons. Two different button types on the same card can cause trouble, so keeping them apart avoids that.
The package name matters here. Microsoft's current package ends in -msteams; the older -teams one is deprecated.

Step 6: Storing tasks in Dataverse
Up to this point, the task list lived in the agent's memory and reset on every restart. I first tried saving it to a local file, which fixed the restarts but wasn't shared or realistic. So I moved the tasks into Dataverse.
One thing I learned early: you can't just point an outside app at a Dataverse table. Dataverse never allows anonymous access. A program has to sign in as an application user linked to an Entra app registration. That sounds heavy, but it's a one-time setup.

On the Dataverse side
1. Create the table. In make.powerapps.com I created a table called Status Task and used its default Name column as the task title. I added a Task number column (whole number) and a Done column (yes/no, default No).
2. Register an app. In the Microsoft Entra admin center I created an app registration named status-helper-dataverse, then copied its client ID and tenant ID.
3. Create a client secret and copied its Value straight away, because it's shown only once. (Copy the Value, not the Secret ID.)
4. Create a security role in the Power Platform admin center with Create, Read and Write on the Status Task table. The application user can't use a default role, so it has to be a custom one.
5. Create the application user in the same admin center, link it to the app registration, and assign the role.
6. Note the Environment URL.
On the project side
I installed two packages, @azure/msal-node (for signing in) and dotenv (for reading settings), and created a file called .env.dataverse in the project root. It holds the tenant ID, client ID, secret, environment URL, the table's name and the names of its ID, title, number and done columns. That file contains a secret, so I added it to .gitignore and never paste its contents anywhere public.
Then I added two small files:
• dataverse.js, which signs in, then lists, creates and updates tasks.
• dataverse-test.js, a tiny script to test the connection before touching the agent.
This step-by-step approach saved me. I ran three tests in order:
1. Sign in: does Dataverse accept my app?
2. Find: which exact names do my table and columns have? The script prints them, so I didn't have to hunt through menus.
3. Seed and list: can I write rows and read them back?
So, is it an agent or a chatbot?
Honest answer: right now it's a rule-based chatbot built on the Agents SDK. It follows fixed commands (status, done N, add) and no AI model decides anything. It would become a true AI agent once a language model interprets free-form requests, like "mark the budget one as done", and chooses which action to run.
That doesn't make it less useful as a learning project. All the pieces an AI agent needs are already here: a channel, structured replies, actions, and real data.
What's next
Two natural follow-ups:
1. Add an LLM so the agent understands natural language and decides which task to act on. That's the step that turns this chatbot into an agent.
2. Deploy it properly to the cloud so it keeps answering when my laptop is off. That needs hosting, usually an Azure subscription, so it's a project of its own.
video reference - https://youtu.be/XJzs0kI_2o8?si=MzohuTimD2RM_opC

Join the conversation! Your thoughts help the community grow.