Skip to main content

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.

tip

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.

RequirementDetails
LLM configurationTIMBR_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 endpointWebhooks 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.

  1. In the Azure Portal, search for Azure Bot and choose Create.

  2. Fill in the form:

    FieldValue
    Bot handleAny name unique in Azure, e.g. timbr-chatbot-prod. Users never see it.
    Subscription / Resource groupWhatever your organization uses.
    Pricing tierThe free tier is enough for Teams messaging.
    Type of AppSingle-tenant - recommended for internal use. Multi-tenant also works; it changes one variable later.
    Creation typeCreate new Microsoft App ID
  3. Create, wait for the deployment, then Go to resource.

note

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.

danger

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.

danger

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​

Build it in your browser

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:

  • id and botId set to your Microsoft App ID
  • validDomains including your Timbr API host
  • The app version - bump this every time you re-upload, or Teams will not offer an update
danger

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.

  1. In Teams, open Apps → Manage your apps → Upload an app → Upload a custom app.
  2. Select the zip you built.
  3. 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 @mentions there.

Updating the app later​

Teams does not auto-update a sideloaded app. To roll out a change:

  1. Bump the version in manifest.json (e.g. 1.0.0 → 1.0.1) and rebuild the package.
  2. Go to Apps → Manage your apps → AskTimbr → Update, and select the new zip.
  3. If Update isn't offered, the version wasn't bumped - remove the app and add it again.

Permissions & security​

PermissionWhy it is needed
messageTeamMembersSend a reply to the person who asked.
validDomainsLimited to your Timbr API host, so Teams will not follow links elsewhere on the app's behalf.
supportsFiles: falseThe 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:

VariableDefaultPurpose
ENABLE_CHAT_BOTfalserequiredMaster switch. The blueprint mounts only when this is true and Teams credentials are present.
CHAT_BOT_DEFAULT_ONTOLOGY-one ofOntology queried when the user doesn't name a source.
CHAT_BOT_DEFAULT_AGENT-one ofAgent used instead of an ontology. Exactly one of these two is required.
CHAT_BOT_TEAMS_APP_ID-requiredAzure Bot → Microsoft App ID. Omit the Teams variables to disable Teams.
CHAT_BOT_TEAMS_APP_PASSWORD-requiredAzure Bot client secret.
CHAT_BOT_TEAMS_TENANT_ID-conditionalRequired for single-tenant registrations; leave empty for multi-tenant. Missing it causes AADSTS700016.
CHAT_BOT_DEFAULT_PARAMS-optionalExtra /answer header overrides as a JSON object, e.g. {"note":"…","concepts-list":"…"}.
CHAT_BOT_MAX_PREVIEW_ROWS50optionalRows shown by Show Result Set.
CHAT_BOT_MAX_EXPORT_ROWS10000optionalRows included in a CSV export.
CHAT_BOT_RESULT_STATE_TTL_SECONDS86400optionalHow long an answer's buttons keep working (24 h).
CHAT_BOT_IDENTITY_CACHE_TTL_SECONDS3600optionalHow long a resolved email is cached.
CHAT_BOT_DEDUP_TTL_SECONDS300optionalWindow for dropping events the platform re-delivers.
CHAT_BOT_INFLIGHT_TTL_SECONDS120optionalOne query per user at a time; also frees the slot if a worker crashes.
CHAT_BOT_TEAMS_ENABLED-derivedComputed 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:

RoutePurpose
GET /timbr/api/chatbot/healthReadiness - reports which channels are enabled
POST /timbr/api/chatbot/teams/api/messagesTeams 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.