Install & Configure
The AskTimbr bot lets your team ask questions about your data in plain English from Microsoft Teams. It runs inside your existing Timbr API service - there is nothing extra to host. This page walks through registering an Azure Bot, configuring the Timbr API service, and installing the app package into Teams.
Once the bot is installed, see Using AskTimbr in Microsoft Teams for what your team can do with it.
Prerequisites
The chatbot is a blueprint mounted inside the Timbr API service at /timbr/api/chatbot/* - it is configured on your existing instance, not a new server.
| Requirement | Details |
|---|---|
| LLM configuration | TIMBR_LLM_TYPE, TIMBR_LLM_MODEL, TIMBR_LLM_APIKEY - the natural language to SQL call is made by the Timbr API service itself. |
| A public HTTPS endpoint | Webhooks are delivered by Azure Bot Service, so your Timbr API host must be reachable from the internet with a valid certificate. This is normally just your existing hostname. |
Turn the chatbot on
Set these on the Timbr API service deployment and restart. The blueprint mounts only when ENABLE_CHAT_BOT is true and the Teams credentials from step 3 are present.
ENABLE_CHAT_BOT=true
CHAT_BOT_DEFAULT_ONTOLOGY=my_ontology # or CHAT_BOT_DEFAULT_AGENT - exactly one is required
This decides what the bot queries when a user doesn't name a source explicitly. Users can always override per question with an ontology: or agent: prefix - see Usage.
Step 1 - Register an Azure Bot
Teams does not talk to your service directly - Azure Bot Service sits in between, so you register a bot resource first. This is a registration only; nothing is hosted in Azure.
In the Azure Portal, search for Azure Bot and choose Create.
Fill in the form:
Field Value Bot handle Any name unique in Azure, e.g. timbr-chatbot-prod. Users never see it.Subscription / Resource group Whatever your organization uses. Pricing tier The free tier is enough for Teams messaging. Type of App Single-tenant - recommended for internal use. Multi-tenant also works; it changes one variable later. Creation type Create new Microsoft App ID Create, wait for the deployment, then Go to resource.
Older documentation refers to a "Bot Channels Registration" resource - that name is retired. The resource you want is Azure Bot.
Step 2 - Configure the endpoint, secret and Teams channel
Messaging endpoint. Open Configuration on the Azure Bot resource and set the messaging endpoint to:
https://<your-timbr-api-host>/timbr/api/chatbot/teams/api/messages
While you're here, copy the Microsoft App ID - you'll need it for both the Timbr API configuration and the app manifest.
Client secret. Go to Configuration → Manage Password → New client secret. Give it a description and an expiry, then copy the Value immediately.
The secret value is shown exactly once. Navigate away and it is gone forever - you would have to create another one. This becomes CHAT_BOT_TEAMS_APP_PASSWORD.
Enable the Microsoft Teams channel. Open Channels, select Microsoft Teams, accept the terms of service, and Save.
Skipping this produces "Invalid Bot" when you install the app in Teams. If you hit that error later, come back here - the fix is one Save.
Step 3 - Configure the Timbr API service
Add the Teams credentials to the Timbr API service environment variables and restart:
CHAT_BOT_TEAMS_APP_ID=<microsoft-app-id>
CHAT_BOT_TEAMS_APP_PASSWORD=<client-secret-value>
CHAT_BOT_TEAMS_TENANT_ID=<directory-tenant-id> # single-tenant bots only
CHAT_BOT_TEAMS_TENANT_ID is required for single-tenant registrations (find it under Entra ID → Overview → Tenant ID). Leave it empty for multi-tenant bots - setting it on a multi-tenant bot breaks it the other way. Missing it on a single-tenant bot fills the logs with AADSTS700016.
Restart the service, then confirm Teams is enabled:
curl https://<your-timbr-api-host>/timbr/api/chatbot/health
{"status":"healthy","teams_enabled":true}
Step 4 - Build the Teams app package
Open the app package builder - fill in the fields below and it generates manifest.json and downloads the finished .zip for you. Nothing you enter ever leaves your browser.
A Teams app is a zip containing exactly three files at the root: manifest.json and two icons (color.png - 192×192 full colour, and outline.png - 32×32, a transparent, monochrome silhouette).
manifest.json needs, at minimum:
idandbotIdset to your Microsoft App IDvalidDomainsincluding your Timbr API host- The app
version- bump this every time you re-upload, or Teams will not offer an update
Do not use Compress-Archive on a folder - it nests the files one level down and Teams rejects the package. Zip the three files themselves, with the manifest named exactly manifest.json.
To check a package before uploading, confirm exactly three non-zero entries with no folder prefix:
python -c "import zipfile,sys; [print(i.filename, i.file_size) for i in zipfile.ZipFile(sys.argv[1]).infolist()]" <your-package>.zip
Step 5 - Sideload the app into Teams
Custom app uploads must be allowed in your tenant first. A Teams administrator enables it in the Teams Admin Center under Teams apps → Setup policies → Upload custom apps.
- In Teams, open Apps → Manage your apps → Upload an app → Upload a custom app.
- Select the zip you built.
- Choose Add for personal use, or Add to a team to use it in a channel. The bot must be added to a channel before it can answer
@mentionsthere.
Updating the app later
Teams does not auto-update a sideloaded app. To roll out a change:
- Bump the version in
manifest.json(e.g.1.0.0→1.0.1) and rebuild the package. - Go to Apps → Manage your apps → AskTimbr → Update, and select the new zip.
- If Update isn't offered, the version wasn't bumped - remove the app and add it again.
Permissions & security
| Permission | Why it is needed |
|---|---|
messageTeamMembers | Send a reply to the person who asked. |
validDomains | Limited to your Timbr API host, so Teams will not follow links elsewhere on the app's behalf. |
supportsFiles: false | The bot never reads or writes files in Teams. |
- Inbound requests are verified. Teams activities are Bot Framework JWT-authenticated; unverified requests are rejected before any work happens.
- Detail stays private. In channels, SQL, result rows and exports are sent as messages visible only to the asker - the channel sees the answer, not the underlying data.
Configuration variables
Everything the chatbot reads for Teams, set on the Timbr API service deployment:
| Variable | Default | Purpose | |
|---|---|---|---|
ENABLE_CHAT_BOT | false | required | Master switch. The blueprint mounts only when this is true and Teams credentials are present. |
CHAT_BOT_DEFAULT_ONTOLOGY | - | one of | Ontology queried when the user doesn't name a source. |
CHAT_BOT_DEFAULT_AGENT | - | one of | Agent used instead of an ontology. Exactly one of these two is required. |
CHAT_BOT_TEAMS_APP_ID | - | required | Azure Bot → Microsoft App ID. Omit the Teams variables to disable Teams. |
CHAT_BOT_TEAMS_APP_PASSWORD | - | required | Azure Bot client secret. |
CHAT_BOT_TEAMS_TENANT_ID | - | conditional | Required for single-tenant registrations; leave empty for multi-tenant. Missing it causes AADSTS700016. |
CHAT_BOT_DEFAULT_PARAMS | - | optional | Extra /answer header overrides as a JSON object, e.g. {"note":"…","concepts-list":"…"}. |
CHAT_BOT_MAX_PREVIEW_ROWS | 50 | optional | Rows shown by Show Result Set. |
CHAT_BOT_MAX_EXPORT_ROWS | 10000 | optional | Rows included in a CSV export. |
CHAT_BOT_RESULT_STATE_TTL_SECONDS | 86400 | optional | How long an answer's buttons keep working (24 h). |
CHAT_BOT_IDENTITY_CACHE_TTL_SECONDS | 3600 | optional | How long a resolved email is cached. |
CHAT_BOT_DEDUP_TTL_SECONDS | 300 | optional | Window for dropping events the platform re-delivers. |
CHAT_BOT_INFLIGHT_TTL_SECONDS | 120 | optional | One query per user at a time; also frees the slot if a worker crashes. |
CHAT_BOT_TEAMS_ENABLED | - | derived | Computed from whether the credentials above are present, and reported by /health. Do not set this yourself. |
Endpoints
Useful when configuring a reverse proxy, a WAF, or an allow-list:
| Route | Purpose |
|---|---|
GET /timbr/api/chatbot/health | Readiness - reports which channels are enabled |
POST /timbr/api/chatbot/teams/api/messages | Teams Bot Framework messaging endpoint |
GET /timbr/api/chatbot/download/<id> | CSV export download |
Troubleshooting
"Invalid Bot" when installing The Microsoft Teams channel is not enabled on the Azure Bot resource. Go to Azure Bot → Channels → Microsoft Teams, accept the terms of service, and Save. Nothing in the app package needs to change - reinstall the same zip.
"Manifest parsing error"
Usually the zip layout: the manifest isn't named exactly manifest.json at the zip root, the files are nested inside a folder, or an icon is a 0-byte file. Rebuild the package and confirm exactly three non-zero entries with no folder prefix.
AADSTS700016 in the logs
A single-tenant bot is requesting tokens from the multi-tenant OAuth endpoint because CHAT_BOT_TEAMS_TENANT_ID is not set. Set it to your directory ID from Entra ID → Overview → Tenant ID and restart. If your Azure Bot is genuinely multi-tenant, leave the variable empty instead.
The installed app didn't update
Teams ignores a package whose version matches what's already installed. Bump version in the manifest, rebuild, then Apps → Manage your apps → AskTimbr → Update. If Update still isn't offered, remove the app and add it again.
/health reports teams_enabled: false
Check for typos in the variable names, confirm ENABLE_CHAT_BOT=true, and confirm the service actually restarted - configuration is read at startup only.