Connect an IT desk's shared mailbox and Teams channel
- graal Agentic Platform
- Version 0.30 (actuelle)
- Open source · Apache 2.0
- Source : graalsystems/tranibor-agents@983db67
For an organisation administrator. Procedure connector.mcp.microsoft-365-desk, version 3, reviewed 2026-11-26 against the vendor’s own pages. It applies to the connector type mcp/microsoft-365-desk.
It ships with the plugin microsoft-365-desk 0.1.3: its source. In the console, once the plugin is installed, it opens with How to set this up on the connector of the plugin’s server, and on Library › Plugins.
Addresses are written <api_url>, <public_url> and <org> here: the console shows the same text with your deployment’s own.
Before you start
Section intitulée « Before you start »- A Microsoft 365 tenant where you can register an application, someone who can grant admin consent, an Exchange administrator (for the mailbox scope), and, for Teams, an Azure subscription (the bot resource) and the owner of the team.
- The
microsoft-365-deskplugin installed in your organisation (Catalogue, Plugins). Its server runs in the platform; there is nothing to host. A plugin that brings a server needs a second person’s approval. - A Tranibor core 0.28.0 or later: it forwards the bot’s signed token to the server (ADR 0198).
- The desk’s shared mailbox (for instance
it-desk@contoso.com), and/or the Teams channel requests are asked in. Each channel is optional; at least one is configured. - What the server answers: the requester, in the original thread (a reply to the mail, or a reply in the Teams thread). It never reads attachments, never writes to another mailbox, and never posts outside the thread of a request.
- This procedure is written from Microsoft’s documentation and the plugin’s fake tenant; it has not yet been run end to end against a live tenant.
At Microsoft
Section intitulée « At Microsoft »The application (Entra admin center).
- Identity, Applications, App registrations, New registration: name
tranibor-desk, Accounts in this organizational directory only, no redirect URI. Copy the Application (client) ID and the Directory (tenant) ID. - API permissions: remove
User.Read. The server reads no profile. - Certificates & secrets, New client secret, with an expiry your policy allows (note the date: the desk stops when it expires). Copy its Value once into your secret manager.
The shared mailbox, and no other (Exchange Online PowerShell). The application must reach the desk’s
mailbox only. Use RBAC for Applications (recommended). Its roles are the application’s mail rights:
do not also grant the Microsoft Graph application permissions Mail.ReadWrite or Mail.Send in
Entra — an Entra grant is tenant-wide and adds to the scoped roles, so every mailbox would be reachable.
-
Connect with
Connect-ExchangeOnline, then register the application’s service principal in Exchange (the Object ID is the one of the application’s Enterprise application, not of its registration):Fenêtre de terminal New-ServicePrincipal -AppId <client id> -ObjectId <enterprise application object id> -DisplayName "Tranibor desk"New-ManagementScope -Name "Tranibor desk mailbox" -RecipientRestrictionFilter "PrimarySmtpAddress -eq 'it-desk@contoso.com'"New-ManagementRoleAssignment -App <client id> -Role "Application Mail.ReadWrite" -CustomResourceScope "Tranibor desk mailbox"New-ManagementRoleAssignment -App <client id> -Role "Application Mail.Send" -CustomResourceScope "Tranibor desk mailbox" -
Check the scope: the desk’s mailbox is in scope, a neighbour’s is not.
Fenêtre de terminal Test-ServicePrincipalAuthorization -Identity <client id> -Resource it-desk@contoso.comTest-ServicePrincipalAuthorization -Identity <client id> -Resource someone.else@contoso.comThe first answers
InScope: Truefor both roles, the secondInScope: False. Role assignments take up to an hour to apply.The older way, an Application Access Policy, also works: grant
Mail.ReadWriteandMail.Sendas Microsoft Graph application permissions in Entra with admin consent, put the mailbox in a mail-enabled security group, thenNew-ApplicationAccessPolicy -AppId <client id> -PolicyScopeGroupId <group address> -AccessRight RestrictAccess -Description "Tranibor desk"and check withTest-ApplicationAccessPolicy -Identity someone.else@contoso.com -AppId <client id>(Denied). Microsoft is replacing these policies with RBAC for Applications.
The bot (Azure portal), for Teams.
- Create an Azure Bot resource: type of app Single Tenant, creation type Use existing app
registration, App ID the client id above, tenant your tenant. (A multi-tenant bot created earlier
works too; set
bot_tenant_idtobotframework.com.) - Its Configuration: Messaging endpoint
<api_url>/api/v1/webhooks/plugins/<org>/microsoft-365-desk/desk. Channels: add Microsoft Teams.
The Teams app, for Teams.
- Build the app package from the plugin’s repository (
teams/is not part of the installed plugin):python teams/build_app.py --client-id <client id> --developer "<your organisation>" --website https://<your site> -o it-desk.zip. It fills the manifest’s placeholders (refusing an id that is not a GUID, a site that is nothttps://, any placeholder left) and adds the two icons Teams asks for,color.png(192 × 192) andoutline.png(32 × 32, white on transparent) — generated, unless you put your own beside the script. The manifest declares the bot (scopeteam) and one resource-specific permission,ChannelMessage.Read.Group: the application reads the messages of the teams the app is installed in, and nothing else. - Teams admin center: allow custom apps for the people who install it, and allow group owners to consent to resource-specific permissions (Microsoft Entra, Enterprise applications, Consent and permissions, or the Teams RSC settings). Upload the app (Teams apps, Manage apps, Upload new app), then the team’s owner adds it to the team and accepts the permission.
- The channel’s ids: in Teams, the channel’s Get link to channel gives
groupId=<team id>and19:…@thread.tacv2(URL-decoded) as the channel id.
Permissions
Section intitulée « Permissions »- Mail, through RBAC for Applications:
Application Mail.ReadWrite(read the Inbox, create a reply draft, set categories and the plugin’s extended properties) andApplication Mail.Send(send that reply), both scoped to the desk’s mailbox. No Microsoft Graph mail permission is granted in Entra. - Teams: the resource-specific permission
ChannelMessage.Read.Groupof the Teams app, consented by the team’s owner: the application reads the channel messages of that team only. The bot answers in a thread through the Bot Connector with its own token; it never reads chats nor other teams. - What the server writes in the mailbox: a reply to the sender (
createReply,send), the categoriesTranibor: <state>andTranibor: Done(a server before 0.1.3 wroteChoregos: …: those messages stay taken, and a state change moves them to the new category), and single-value extended properties (the plugin’s property set{793633a1-729c-497c-930e-276450befa92}) holding the action key of each reply and Tranibor’s status. - In Tranibor, the server’s descriptor is the floor: reads are allowed;
replyis a write and waits for approval unless your organisation’s policy decides otherwise. The tracker writes (tracker_*) are the platform’s own calls, audited, not approved one by one;tracker_commentwrites nothing, so the platform’s own comments never reach the requester.
In Tranibor
Section intitulée « In Tranibor »- Catalogue, Plugins,
microsoft-365-desk, Configure. tenant_id,client_idfrom step 1;client_secretfrom step 3 (sealed, shown once).mailbox: the desk’s address.teams: one{team_id, channel_id}per channel from step 10.bot_tenant_id: leave it empty for a single-tenant bot (step 6): the bot gets its token fromtenant_id. Typebotframework.comfor a multi-tenant bot. Leavebot_app_idempty when the bot is the same application.- Leave
service_urlathttps://smba.trafficmanager.net/teams/: each verified activity names the service URL replies go to, and the server uses it; the default serves until the first one arrives. The server reachessmba.trafficmanager.netonly; a sovereign cloud’s Bot Connector (another host) needs a new version of the plugin, whose declaration lists that host. - Make the desk the tracker of a project (
plugin:microsoft-365-desk/desk), whose start label isstart_label.
- Press Test on the connector: the server answers and serves the eight tracker tools and
reply. - Send a mail to the desk’s mailbox. Within the polling interval it appears on the project’s board;
in Outlook, the message gets the category
Tranibor: …once Tranibor takes it. - Approve a
replyof the agent: the sender receives an answer in the same conversation (RE: …), once, even if the action is replayed. - In the Teams channel, post a message that mentions the bot. It becomes a work item; the platform’s webhook log shows the delivery verified.
- Approve a reply: it appears in the thread, ending with
Ref: desk-…. - Check the scope once more:
Test-ServicePrincipalAuthorizationfor a neighbour’s mailbox still answersInScope: False.
When it fails
Section intitulée « When it fails »unauthorized: Entra refused the application's credentials: a wrong client id or secret, or the secret expired.forbidden: Microsoft Graph refused the application (ErrorAccessDenied)on the mailbox: the RBAC role assignments are missing or not applied yet (up to an hour), ormailboxis not the scoped mailbox.- Every Teams delivery answered
401: the bot’s messaging endpoint is not the webhook URL above, the bot’s App ID is notclient_id(orbot_app_id), or the platform is older than 0.28.0 and drops theAuthorizationheader. - A delivery verified but no work item: the channel is not in
teams, the message does not mention the bot, or it mentions it and says nothing else. forbiddenreading a Teams message: the Teams app is not installed in that team, or the owner did not consent toChannelMessage.Read.Group.- A Teams reply refused with
unauthorized(Entra or the Bot Connector):bot_tenant_iddoes not match the bot’s type. A single-tenant bot: leave it empty (or type your tenant id); a multi-tenant bot:botframework.com. The bot’s type is the one chosen in step 6. - A mail skipped by
tracker_list_candidates(itsreasonsays how many): its id is longer than a key allows. Answer it by hand. - A mail that never becomes a work item: an automatic one (an
Auto-Submittedheader, an out-of-office reply, a delivery report), or a follow-up in a conversation the desk already took (a message of it is categorisedTranibor: …, orChoregos: …from a server before 0.1.3). Remove the category from the taken message to let the thread be taken again. - A
replyrefused withwork_item_key: the action has no work item, or belongs to another request than the one it answers; a fan-out child answers its parent’s requester only.
| Field | What to put in it |
|---|---|
bot_app_id |
empty, unless the bot is another application than client_id |
bot_tenant_id |
empty for a single-tenant bot (the default for new bots: its token comes from tenant_id); botframework.com for a multi-tenant one |
client_id |
the Application (client) ID of the application registered below (also the bot’s Microsoft App ID) |
client_secret |
a client secret of that application, typed once |
mailbox |
the shared mailbox’s address, e.g. it-desk@contoso.com; leave empty for Teams only |
service_url |
leave the default, https://smba.trafficmanager.net/teams/ |
start_label |
the start label of the project that takes the requests, agent-ready by default |
teams |
the channels the bot answers in, each {team_id, channel_id}; leave empty for mail only |
tenant_id |
the Directory (tenant) ID of your Entra tenant |
Network egress
Section intitulée « Network egress »Hosts the platform must be allowed to reach:
graph.microsoft.comlogin.microsoftonline.comlogin.botframework.comsmba.trafficmanager.net
Vendor documentation
Section intitulée « Vendor documentation »- Register an application in Microsoft Entra ID
- Add and manage application credentials
- Role Based Access Control for Applications in Exchange Online
- Limiting application permissions to specific Exchange Online mailboxes
- Microsoft Graph permissions reference
- Obtain immutable identifiers for Outlook resources
- Create an Azure Bot resource
- Authentication with the Bot Connector API
- Resource-specific consent for Teams apps
- Teams app manifest schema