Vercel — AI · · 2 min read

Vercel Connect now supports Microsoft Teams

Mirrored from Vercel — AI for archival readability. Support the source by reading on the original site.

Vercel Connect now includes a managed connector for Microsoft Teams. Creating one gives your organization a Teams bot that your apps and agents run. People can @mention it in channels or message it directly, and your code receives the message and replies as the bot.

As a Vercel Managed Connector, Vercel registers the Entra app and Azure Bot resource in your tenant, so there's no client secret to store. A tenant administrator with an Azure subscription completes setup once. Incoming Teams activities are verified and forwarded to your project as Connect trigger.

Create a connector from the dashboard or Vercel CLI:

vc connect create microsoft-teams --name acme-teams --triggers

Create a Teams connector with triggers enabled

Once the connector is set up, your code requests a token only when it needs one. Use it with the @vercel/connect SDK, eve channel or Chat SDK adapter:

app/lib/post-to-teams.ts
import { getToken } from '@vercel/connect';
export async function POST(request: Request) {
const activity = await request.json();
const token = await getToken('microsoft-teams/acme-teams', {
subject: { type: 'app' },
scopes: ['https://api.botframework.com/.default'],
const botFramework = activity.serviceUrl.replace(/\/$/, '');
await fetch(
`${botFramework}/v3/conversations/${activity.conversation.id}/activities/${activity.id}`,
method: 'POST',
headers: {
Authorization: `Bearer ${token}`,
'Content-Type': 'application/json',
body: JSON.stringify({
type: 'message',
from: activity.recipient,
recipient: activity.from,
conversation: activity.conversation,
replyToId: activity.id,
text: 'Hello friend.',
return new Response(null, { status: 200 });

Receive a forwarded Teams message and reply to it as the bot through the Bot Framework API

Each token is scoped to what you request and refreshed automatically, so there's nothing to rotate by hand. Connectors only work in the environments you attach them to, and you can revoke access at any time with vc connect revoke-tokens.

Read the Vercel Connect documentation, view details about the Teams connector in the Vercel Connect catalog, or create a Teams connector to get started.

Contributors

Hedi Zandi, Dima Voytenko

Discussion (0)

Sign in to join the discussion. Free account, 30 seconds — email code or GitHub.

Sign in →

No comments yet. Sign in and be the first to say something.

More from Vercel — AI