Skip to content

Answer approvals in Microsoft Teams: set up the DueReason bot

Register an Azure Bot, upload the DueReason Teams app, and let approvers answer Approve or Decline inside Teams messages instead of opening a link every time.

Updated · 7 min read

In short

  • A notification channel already posts to a Teams channel today through an incoming webhook; the DueReason Teams app adds Approve/Decline buttons an eligible approver can answer right inside the message, with a typed reason when one is required.
  • Setup is three things done once: register an Azure Bot (multi-tenant), upload the DueReason app package to Teams, then add the app to a team, channel or chat and paste the pairing code it posts into Settings > Notifications.
  • Self-hosting it needs three server env vars - unset, the bot's endpoint answers 404 and every Teams channel keeps working exactly as it does with a plain webhook.
  • This is opt-in per channel: a webhook-connected channel that never installs the app is unaffected, and installing the app does not remove the option to keep using a plain webhook instead.

A Teams channel already hears about approval requests today through an incoming webhook, the same way a Slack channel does: DueReason posts a message, and an approver opens a link to answer it in the console. The DueReason Teams app adds a second, opt-in way to connect a channel - one where an eligible approver answers Approve or Decline right inside the Teams message, typing a reason when the step requires one, with no link to open and no separate sign-in. Nothing about the webhook path changes: a channel that never installs the app keeps working exactly as it does now. This pairs well with any approval you already route through Teams - for example, access request approvals answered right inside a Teams card instead of over a DM.

What you're setting up

Three things, each done once:

  1. An Azure Bot resource (multi-tenant), which gives you the app id and password DueReason needs to call the Bot Framework Connector API and to verify the activities Teams sends it.
  2. The DueReason Teams app package, uploaded either org-wide (a Teams admin installs it for everyone) or sideloaded into one team for a smaller rollout.
  3. The app added to the team, channel or chat you want connected, paired once from DueReason's Settings > Notifications with a short code the bot posts there.

Register the Azure Bot

In the Azure Portal, create an Azure Bot resource:

  • Type of App: Multi Tenant - this lets one bot registration serve every organization's Teams tenant, rather than being locked to yours.
  • Messaging endpoint: https://your-host/api/teams/messages (https://duereason.com/api/teams/messages for the hosted product).
  • Add the Microsoft Teams channel to the bot (Channels, Microsoft Teams, Save) - without this, Teams never delivers activities to your endpoint even if the app is installed.

Once it is created, the resource's Configuration page shows the Microsoft App ID - this becomes both TEAMS_BOT_APP_ID and the app package's own id/botId (Teams requires a single-bot app's manifest id to match its bot id). Generate a client secret under Certificates & secrets - this becomes TEAMS_BOT_APP_PASSWORD. Treat it like any other credential: it is never committed to source control, and on DueReason's own infrastructure it only ever exists sealed, inside the cluster.

Build and upload the app package

DueReason's repository ships a manifest template and the two required icons in duereason/teams-app/; a small script fills in your bot's app id and zips the package:

``bash node duereason/teams-app/scripts/build-package.mjs --app-id 11111111-2222-3333-4444-555555555555 --out teams-app.zip ``

Upload teams-app.zip one of two ways:

  • Org-wide: Teams admin center > Teams apps > Manage apps > Upload new app. Anyone in the org can then add it from Teams' own app catalog.
  • Sideload into one team: in Teams, open Apps > Manage your apps > Upload an app > Upload a custom app, and pick the team to add it to. Good for trying it out before an org-wide rollout.

Connect a team, channel or chat

Add the DueReason app to whichever team, channel or 1:1/group chat you want approvals to reach - the same way you'd add any Teams app. The bot replies there with a short pairing code, valid for 30 minutes and usable once.

In DueReason, go to Settings > Notifications, add a channel, choose Microsoft Teams as where and Connect with the DueReason Teams app as how, and paste that code. The channel is now bot-delivered: cards post with Approve/Decline buttons instead of a plain message.

An individual approver who wants to click those buttons (rather than always opening the request) also connects their own account once: Settings > Notifications > Microsoft Teams, pasting their Azure AD object id (Microsoft Entra admin center > Users > their account > Object ID). Without that mapping, DueReason can't tell which member clicked, and the card asks them to connect first.

Self-hosting it

Three environment variables, and they travel together - set none of them and the messaging endpoint answers 404, with every Teams channel behaving exactly as it does today (webhook only):

VariableWhat it controls
TEAMS_BOT_APP_IDThe Azure Bot's Microsoft App ID; also the Teams app manifest's own id and the JWT aud claim every inbound activity must carry.
TEAMS_BOT_APP_PASSWORDThe same app's client secret, used to call the Bot Framework Connector API (posting and updating cards).
TEAMS_BOT_TENANTOptional. Your Entra tenant id, for a single-tenant deployment. Unset, the bot accepts a connecting member from any tenant and matches purely on their Teams user id - fine for a single-organization self-host, worth setting once you have more than one Entra tenant talking to the same bot.

What stays the same either way

Nothing about today's webhook-connected channels changes. A Teams channel connected through Workflows > "Send webhook alerts to a channel" keeps posting and keeps working with no bot, no Azure registration and no app install - the bot is an additional, opt-in delivery method for the channels that want in-message buttons, not a replacement for the one that already exists.

Questions

Do we have to install the Teams app, or can we keep using the webhook?
The webhook stays the default and keeps working with no changes. Installing the DueReason Teams app is opt-in, per channel - a channel can keep its webhook, switch to the app, or (for different channels) use both.
Can one Azure Bot registration serve more than one organization's Teams tenant?
Yes, if you register it as Multi Tenant (the default this guide uses): any organization can add the app and pair a channel, and member Teams account connections are matched without a tenant check unless you set TEAMS_BOT_TENANT.
What happens if TEAMS_BOT_APP_ID or TEAMS_BOT_APP_PASSWORD is missing?
The messaging endpoint (/api/teams/messages) answers 404 to every request, and the Teams app delivery option in Settings > Notifications stays locked. Webhook-connected Teams channels are unaffected either way.
Does an approver need to install anything themselves to click Approve/Decline?
No new install - once their organization's channel is connected, an approver only needs to paste their own Azure AD object id once, in Settings > Notifications > Microsoft Teams, so DueReason can map their click to their DueReason account.

Connect Teams from your own console

Sign in, open Settings > Notifications, and add a Microsoft Teams channel - start with the webhook today, add the bot whenever you're ready for in-message Approve/Decline.

Open Settings

Sources

This guide explains the regulation as we read it; it is not legal advice. Check the official text and your national law, which may add obligations.

Start with DueReason

Create a free account, try it live, or talk to us about your workflow.

Get product updates