Skip to main content
Unlisted page
This page is unlisted. Search engines will not index it, and only users having a direct link can access it.

Start an agent from Microsoft Teams

Summary​

You can start a hired agent from a Teams channel. Someone mentions the bot with a pull request (PR) link, the agent reviews the PR, and the thread shows the progress. Someone else in the channel approves the review from a card in the thread.

The bot is yours. You create it in your own Microsoft Azure account, and you tell it to send its messages to a URL that DataDios gives you. DataDios does not run a shared bot for all customers.

Setup has five parts, in this order:

  1. Register an app in Microsoft Entra ID
  2. Create the Azure Bot
  3. Add the bot to DataDios
  4. Point the bot at DataDios and turn on Teams
  5. Put the bot in a team

Before you start​

  • A hired agent. See Hire an agent. The agent must be on duty when someone asks it for a review.
  • A GitHub data source for the agent, as for any review.
  • Access to the Azure portal and to Microsoft Entra ID in your organization's tenant. You need to be able to create an app registration and an Azure Bot resource.
  • A Teams administrator who allows custom app upload, or who can upload the app for you. See Prepare your Microsoft 365 tenant.
  • Your DataDios server must be reachable from the internet over HTTPS, because Microsoft sends every message to it. If you run DataDios yourself, an administrator also sets the server's public API address and the key that protects trigger URLs. If adding a trigger fails with trigger_not_configured, one of them is missing: ask your administrator.

1. Register an app​

The app registration is the bot's identity.

  1. Sign in to the Microsoft Entra admin center.
  2. Go to Entra ID, then App registrations, and click New registration.
  3. Enter a Name, for example DataDios review bot.
  4. Under Supported account types, pick Single tenant only. DataDios accepts messages only from your own tenant, and Microsoft no longer creates new multi-tenant bots.
  5. Click Register.
  6. On the Overview page, copy the Application (client) ID and the Directory (tenant) ID. You need both later.
  7. Go to Certificates & secrets, then Client secrets, then New client secret. Add a description, pick an expiry, and click Add.
  8. Copy the secret Value now. Azure never shows it again.

Write down the date the secret expires. Microsoft allows at most 24 months and recommends less than 12. When it expires, the bot stops replying. See Troubleshooting.

Microsoft's guides: Register an app and Add a client secret.

2. Create the Azure Bot​

  1. In the Azure portal, click Create a resource, search for bot, and select the Azure Bot card. Click Create.
  2. Fill in Project details: a bot handle, your subscription and a resource group.
  3. Under Microsoft App ID, choose Single Tenant and choose to use the existing app registration from step 1. Enter its client ID and tenant ID.
  4. Click Review + create, then Create.

You do not host any bot code. DataDios receives the messages. The bot resource only connects Teams to the URL you set in part 4.

Microsoft's guide: Register a bot with Azure.

3. Add the bot to DataDios​

Add the bot fields to a Microsoft Teams data source​

A Microsoft Teams data source can hold a webhook, bot fields, or both. The bot fields are:

FieldValue
tenant_idThe Directory (tenant) ID from part 1.
client_idThe Application (client) ID from part 1.
client_secretThe secret Value from part 1.

The webhook URL is optional, so a source can hold only these three fields. They must all be filled in together. To create the source, follow Microsoft Teams and fill in the bot fields. To use an existing source, open it from Data Explorer and add them.

Keep the webhook URL on the source if you also start runs from DioS. A run started in DioS has no Teams thread, so DataDios sends its notices as plain text through the webhook. See Runs started in DioS. A run started from Teams sends its notices to its Teams thread.

Add a Teams trigger to the agent​

A trigger is how an agent starts without someone opening DioS.

  1. In DioS, open the agent's page and go to its triggers panel.
  2. Add a trigger of kind Microsoft Teams, and pick the Teams data source from above.
  3. DataDios shows the messaging URL. Copy it now. DataDios shows it once.

When you add the trigger, DataDios uses the bot fields to fetch a token for the bot from your tenant. If that fails, DataDios refuses the trigger and creates nothing. Check the three fields and try again. An agent can have one Teams trigger.

The URL ends in a token that belongs to this trigger. Treat it like a password. Anyone who has it can point a bot at your agent, but DataDios still refuses every message that Microsoft did not sign for your bot's client ID and your tenant.

If you put your own HTTPS proxy in front of DataDios, configure it not to log request paths for the trigger URL, because the URL contains the trigger's secret.

The panel also lets you change who may start the agent and how many runs may be open at once (an open run is one that is queued or running, or held in place while it waits for approval). By default, anyone in the channel can ask, and a trigger allows 5 open runs. The panel also shows when the bot last reached DataDios and what happened to that message. See Troubleshooting.

4. Point the bot at DataDios and turn on Teams​

  1. In the Azure portal, open your Azure Bot resource and go to Configuration.
  2. Paste the messaging URL into Messaging endpoint, and apply the change.
  3. Go to Channels and select Microsoft Teams.
  4. Accept the terms of service, pick the cloud environment on the Messaging tab, and click Apply.

Microsoft's guide: Connect a bot to Microsoft Teams.

5. Put the bot in a team​

Teams only lets people talk to a bot that belongs to a Teams app. So you make a small app package that points at your bot, and add it to the team.

Make the app package​

Make a folder with three files:

  • manifest.json, shown below.
  • color.png: a full-colour icon, 192 by 192 pixels.
  • outline.png: a transparent icon with a white outline, 32 by 32 pixels.
{
"$schema": "https://developer.microsoft.com/json-schemas/teams/v1.29/MicrosoftTeams.schema.json",
"manifestVersion": "1.29",
"version": "1.0.0",
"id": "<a new GUID>",
"developer": {
"name": "<your company>",
"websiteUrl": "https://<your site>",
"privacyUrl": "https://<your site>/privacy",
"termsOfUseUrl": "https://<your site>/terms"
},
"name": { "short": "DataDios reviewer", "full": "DataDios code review agent" },
"description": {
"short": "Reviews a pull request when you mention it.",
"full": "Mention the bot with a pull request link and the DataDios agent reviews it."
},
"icons": { "outline": "outline.png", "color": "color.png" },
"accentColor": "#4464EE",
"bots": [
{
"botId": "<the Application (client) ID from part 1>",
"scopes": ["team"],
"supportsFiles": false,
"isNotificationOnly": false
}
]
}

botId must be the same client ID you gave the Azure Bot. Use the team scope so the bot works in team channels. Check manifestVersion against Microsoft's current manifest schema; use the latest stable version it lists, which may be newer than the one in this example. Zip the three files with manifest.json at the top level of the zip, not inside a folder. Microsoft's guide: Package your app.

Upload it and add it to the channel​

  1. In Teams, go to Apps, then Manage your apps, then Upload an app.
  2. Pick Upload a custom app and choose your zip file.
  3. Click Add, then pick the team and channel where people will ask for reviews, and click Go.

If Upload a custom app is missing, your tenant does not allow custom app upload. Ask a Teams administrator. Microsoft's guide: Upload your custom app.

Private channels are limited. Microsoft says a bot can't post messages or cards in a private channel conversation, so use a standard channel.

Use it​

In the channel, mention the bot with a pull request link:

@DataDios reviewer review https://github.com/acme/shop/pull/42

Teams only delivers a message to the bot when it is mentioned by name. The message needs exactly one PR link. With none, or with two different links, the bot answers with a short usage hint ("Send me one pull request link, for example: review https://github.com/owner/repo/pull/123") and starts nothing.

What the thread shows next:

You seeWhat it means
"Queued, 3 ahead of you"The run is waiting for a free slot. The number is your place in line. With nobody ahead, it reads "Queued, you are next".
"On it"A new message when the run starts. It does not edit "Queued", and when Microsoft is slow it can arrive before it. A run resumed after an approval does not post it again.
An approval cardThe agent wants to post its review and waits for a decision. See The approval card.
A link and a short summaryThe run ended. A run that stopped early reads "Stopped:", the reason and the link instead.
"This agent is off duty right now."The agent is off duty. Nothing started. Put it on duty.
"Busy right now, try again later."The agent has reached its open-run limit. Nothing started.
"Sorry, you are not allowed to start runs of this agent."The trigger limits who may start the agent, and you are not on its list. Nothing started.
"Sorry, I could not start that run."DataDios could not start the run. Nothing started.

The approval card​

The card is a reply under the message that started the run. One approval gets one card, so two held actions give two cards. The card shows:

  • What the agent wants to do: the action and the PR it is for, then the reason the agent gave.
  • An excerpt of the review the agent wants to post. Values with credential-like names are masked. If the proposed review was too long to keep in full, the excerpt is left out.
  • A link, Open the full review in DataDios, to the Approvals page.
  • Approve and Reject buttons.

The card has no count of findings. The review is one block of text.

Who can decide​

Anyone who can see the card can decide on it, except the person who asked for the run. If the requester clicks Approve or Reject, DataDios refuses with a short reason in the thread: "The requester can't approve their own request." The agent's owner can also limit the approvers to specific people, or to approvals made in DataDios, in the trigger's settings. Anyone else then gets "Sorry, you are not allowed to decide approvals of this agent." Teams tells DataDios who clicked, so nobody needs a DataDios login to decide.

A click on a card that belongs to another channel or chat is ignored. The clicker sees "This card belongs to another conversation", and nothing is posted in either thread. Known limit: a click from another thread in the same channel is accepted for now. If the approval was already decided, has expired, or its run has ended, the click says so and changes nothing.

After a decision, from Teams or from the Approvals page in DioS, the card is replaced in place. It loses its buttons, and its first line says who decided and when, for example "Approved by Sam at 2026-11-04 10:15 UTC". A decision made on the page reads "in DataDios" instead of a name. An approval that expires leaves its card as it was.

If someone rejects the review, or nobody decides in time, the run ends and nothing is posted to the PR. The thread gets a "Stopped:" line with the reason and a link to the run.

The run acts as the agent's owner, so it can read only what the GitHub data source can read.

While a run waits for approval, it does not hold one of the agent's run slots, and it does not count toward the trigger's open-run limit. A run held in place, which still holds its container, does count. An approval request stays open for up to 5 hours.

Runs started in DioS​

A run started in DioS has no Teams thread, so it gets no card. DataDios sends plain text notices to the webhook of the agent's notify channel instead: one when the run waits for approval, naming the action and the PR with a link to the Approvals page, and one when the run ends. Decide on the Approvals page.

Change or remove the URL​

To get a new URL, rotate the trigger in the agent's triggers panel. The old URL stops working at once. Paste the new one into the bot's Messaging endpoint as in part 4. Until you do, the bot gets no replies.

Removing the trigger kills its URL.

Troubleshooting​

The bot does not reply at all. DataDios answers only messages it can verify, and refuses the rest without a reply. Check in this order:

  1. The Messaging endpoint on the Azure Bot is the current URL, with no extra spaces, and was not replaced by rotating the trigger.
  2. The Microsoft Teams channel is turned on for the Azure Bot.
  3. The bot is added to the team and you mention it by name in a standard channel.
  4. The Azure Bot uses the same client ID and tenant as the client_id and tenant_id on the Teams data source.
  5. The server is reachable over HTTPS from the internet.

The trigger's panel in DioS shows when the bot last reached DataDios and what happened to that message: it started a run, or it was turned away because of who sent it, a missing PR link, an agent that is off duty, a full agent, or a failure to start. A message that fails DataDios's checks (a wrong or rotated URL, the wrong bot or tenant) is not recorded and gets no reply, so it never shows there. If the panel shows no recent message, look at the URL, Azure and Teams.

The bot refuses you. The bot answers "Sorry, you are not allowed to start runs of this agent." when the trigger limits who may start the agent and you are not on the list. Ask the agent's owner to change who may trigger in the triggers panel.

It replied before, and now it is silent. The client secret probably expired. DataDios cannot send replies without it. The bot stops replying, and DataDios logs each failed reply. Watch the expiry date you wrote down. In Entra, add a new client secret to the app registration as in part 1, then put the new value in client_secret on the Teams data source. Write down the new expiry date.