AI · Azure

Building a Bot with Node.js: From Bot Framework SDK to the Microsoft 365 Agents SDK

The Bot Framework SDK is archived and out of support. Here's how to build the same Node.js bot today with the Microsoft 365 Agents SDK.

·3 min read
On this page

If you found this post looking for a Bot Framework SDK tutorial for Node.js, here’s the thing you need to know first: Microsoft has archived the Bot Framework SDK and the Bot Framework Emulator on GitHub, and stopped servicing support tickets for the SDK on December 31, 2025. Microsoft’s support page points new work to the Microsoft 365 Agents SDK, which has the same activity-based model and runs on the same Azure Bot Service channels.

So this post now shows the same “echo bot” walkthrough it always had, written with the Agents SDK. If you have an existing botbuilder bot, there’s a section on migrating at the end.

Which SDK should you use?

  • A bot or agent that should work across channels (web chat, Teams, Microsoft 365 Copilot, others): the Microsoft 365 Agents SDK, available for JavaScript, C# and Python.
  • Something that only lives in Microsoft Teams: Microsoft recommends the Teams SDK.
  • Business users building it without code: Copilot Studio.

1. Create the project

You need Node.js 22 or newer. The Yeoman generator (yo botbuilder) from the old version of this post belongs to the archived SDK, so we start from a plain npm project:

mkdir echo-agent && cd echo-agent
npm init -y
npm install @microsoft/agents-hosting @microsoft/agents-hosting-express

2. Write the agent

Create index.mjs:

import { startServer } from '@microsoft/agents-hosting-express'
import { AgentApplication, MemoryStorage } from '@microsoft/agents-hosting'

class EchoAgent extends AgentApplication {
  constructor (storage) {
    super({ storage })
    this.onConversationUpdate('membersAdded', this._welcome)
    this.onMessage('/help', this._welcome)
    this.onActivity('message', this._echo)
  }

  _welcome = async (context) =>
    await context.sendActivity('Hi. Send me anything and I will repeat it. Type /help to see this again.')

  _echo = async (context) =>
    await context.sendActivity(`You said: ${context.activity.text}`)
}

startServer(new EchoAgent(new MemoryStorage()))

Compared with Bot Framework code, AgentApplication replaces ActivityHandler, and you register routes (onMessage, onActivity, onConversationUpdate) instead of overriding methods. startServer sets up Express and the /api/messages endpoint for you.

3. Run and test it locally

node index.mjs

It listens on port 3978. With no app ID configured it runs in anonymous mode, which is fine for local testing. We ran this exact code against @microsoft/agents-hosting-express 1.10.1 and it echoed messages back as expected.

The Bot Framework Emulator is archived too. Its replacement is the Microsoft 365 Agents Playground. In a second terminal:

npm install -D @microsoft/teams-app-test-tool
npx teamsapptester

A browser window opens, connects to http://localhost:3978/api/messages, and you can chat with the agent.

4. Add language understanding

The old post suggested LUIS and QnA Maker. Both are retired. Your options now:

  • Call a language model (for example Azure OpenAI in Microsoft Foundry) from your message handler. For most new bots this is what we’d do.
  • Use conversational language understanding (CLU) or custom question answering in Azure AI Language if you want predictable intent classification or a curated FAQ.

5. Deploy

  1. Host the Node.js app somewhere with a public HTTPS endpoint: Azure App Service, Azure Container Apps or AKS all work.
  2. Create an Azure Bot resource and point its messaging endpoint at https://your-app/api/messages. Choose a single-tenant or user-assigned managed identity bot; Microsoft stopped allowing new multi-tenant bots after July 31, 2025.
  3. Give the app its identity settings (client ID, tenant ID, and a secret or managed identity) through environment variables, never in code.
  4. Turn on the channels you need, such as Teams or Web Chat, from the Azure Bot resource.

The Agents SDK quickstart covers the same steps in C# and Python if your team prefers those.

Migrating an existing Bot Framework bot

Your bot won’t stop working the day support ends, and the Azure Bot Service itself is still running. But you won’t get security fixes, so plan the move. Microsoft’s migration guidance maps the old packages and classes to the new ones. The activity handling logic usually moves over with modest edits because the concepts map closely; the bigger work is replacing LUIS or QnA Maker calls and any Composer-built dialogs.

We’re GDS, a consulting team that builds AI automations and runs them in our clients’ own cloud. If that’s on your plan, here’s what we do.

Carlos Noguera

AI solutions architect, GDS. CISSP-certified architect for AI, cloud and DevOps. Leads GDS engagements from the first call through support.

What should your team stop doing by hand?

A free 20-minute AI Fit Call shows where AI helps first and what it would take.

Book a free AI Fit CallNot ready for a call? Email us