Table of Contents

Teams Bot

teams-bot is a standalone, multi-tenant Microsoft Teams bot service for Automaton. It is not the diagnostic bot: it owns installation state and the Automaton-facing Teams surface, and it persists to the shared Reignite SQL Server.

Stack and backing store

  • Stack: C# / .NET 8 / ASP.NET Core / EF Core / SQL Server.
  • Store: installation records live in SQL Server, schema teams, table Installations of the shared Reignite database.
  • Migrations: EF Core migrations are applied at startup when a connection string is configured.
  • Least privilege: TeamsBotDbContext maps only the teams schema tables the service needs. It does not map the rest of the database that the API's SpeContext covers.
  • Secrets: the client secret is never stored. CredentialRef is the name of the credential that resolves to it.

Configuration

Setting Purpose
ConnectionStrings__SqlServerConnection SQL Server connection string (App Service setting; never committed).
WEBSITES_PORT / PORT Listen port (defaults to 8080).

A missing connection string is not fatal: /health returns unconfigured and /api/installations returns 503, so the process stays up and diagnosable.

Endpoints

Endpoint Behaviour
GET /health Readiness: ok (DB reachable and at least one enabled installation), unconfigured, or degraded.
GET /api/installations Read-only installation registry (no credential references).
GET /api/installations/{id} One installation.
POST /webhook/teams Reserved; returns 501 until Bot Framework JWT validation and the activity handler land.

Build, test, deploy

dotnet build TeamsBot.sln -c Release
dotnet test tests/TeamsBot.Tests/TeamsBot.Tests.csproj -c Release

The service deploys as its own Azure App Service (TeamsBotIntegrationApp) on the existing shared App Service plan — a sibling app on a plan adds no plan cost. Runtime DOTNETCORE|8.0, startup command dotnet TeamsBot.dll.

Why .NET and SQL Server

v0.1 was a TypeScript/Node service with an env/JSON-file registry. It was migrated to .NET and SQL Server because the portfolio stack is .NET and the bot must share the backend's SQL Server data layer. The migration is an extraction, not a feature build-out.

Difference from the diagnostic bot

Diagnostic Bot Teams Bot
Audience Teams users asking about the Reignite control plane Automaton's Teams integrations
Data Reads the control plane through the API Owns installation state in SQL Server
Write access Read-only plus an asynchronous diagnosis request Installation registry (writes arrive with the authenticated admin surface)
Ingress POST /api/teams/bot POST /webhook/teams (reserved, 501)

Security

  • Store the connection string in App Service settings, never in appsettings.json in the repo.
  • Keep the DbContext least-privilege; do not widen it to the API's full schema.
  • Treat CredentialRef as a pointer, not a secret. Resolve it through the configured credential store.
  • The reserved webhook must not be enabled without Bot Framework JWT validation.