Getting Started
Build and run an echo bot in under five minutes.
Prerequisites
Teams CLI — creates bot registrations and provides credentials:
bashnpm install -g https://github.com/heyitsaamir/teamscli/releases/latest/download/teamscli.tgz teams loginDev tunnel — exposes your local port so Microsoft Teams can reach your bot. Install Dev Tunnels or ngrok.
Language runtime (pick one):
- .NET 10 SDK — for the C# implementation
- Node.js 20+ — for the TypeScript implementation
- Python 3.11+ — for the Python implementation
TIP
Don't have the Teams CLI? You can also set up credentials manually through the Azure portal — see Authentication & Setup.
Step 1 — Start a dev tunnel
devtunnel host -p 3978 --allow-anonymousCopy the HTTPS URL from the output (e.g. https://your-tunnel.devtunnels.ms).
Using ngrok instead?
ngrok http 3978Copy the Forwarding HTTPS URL from the output.
WARNING
Tunnel URLs are ephemeral — they change each time you restart. If you switch tunnels, update the endpoint with teams app edit <appId> --endpoint "https://<new-url>/api/messages".
Step 2 — Create the Teams app
teams app create --name "MyBot" --endpoint "https://<tunnel-url>/api/messages" --jsonThe command returns JSON with your credentials and an install link:
{
"credentials": {
"CLIENT_ID": "...",
"CLIENT_SECRET": "...",
"TENANT_ID": "..."
},
"installLink": "https://teams.microsoft.com/l/app/..."
}Save the credentials for your language:
{
"AzureAd": {
"ClientId": "<CLIENT_ID from output>",
"ClientSecret": "<CLIENT_SECRET from output>",
"TenantId": "<TENANT_ID from output>"
}
}CLIENT_ID=<from output>
CLIENT_SECRET=<from output>
TENANT_ID=<from output>CLIENT_ID=<from output>
CLIENT_SECRET=<from output>
TENANT_ID=<from output>Keep the installLink — you'll use it to add the bot to Teams after the server is running.
Step 3 — Run the echo bot
using Botas;
var app = BotApp.Create(args);
app.On("message", async (ctx, ct) =>
{
await ctx.SendAsync($"You said: {ctx.Activity.Text}", ct);
});
app.Run();import { BotApp } from 'botas-express'
const app = new BotApp()
app.on('message', async (ctx) => {
await ctx.send(`You said: ${ctx.activity.text}`)
})
app.start()from botas_fastapi import BotApp
app = BotApp()
@app.on("message")
async def on_message(ctx):
await ctx.send(f"You said: {ctx.activity.text}")
app.start()Run it
cd dotnet
dotnet run --project samples/EchoBotcd node
npm install && npm run build
npx tsx samples/echo-bot/index.tscd python/samples/echo-bot
pip install -e .
python main.pyTry it
- Open the
installLinkfrom Step 2 in your browser to add the bot to Microsoft Teams. - Send it a message — you should see your text echoed back.
INFO
Each language provides a zero-boilerplate BotApp wrapper. For advanced integration (custom DI, middleware, alternative frameworks), see the language guides: .NET · Node.js · Python.
Next steps
- Teams Features — send mentions, adaptive cards, and suggested actions
- Language guides — deeper coverage of each implementation
- Middleware — extend the turn pipeline with logging, error handling, and more
- Authentication & Setup — manual Azure portal setup (without Teams CLI)