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, tableInstallationsof the shared Reignite database. - Migrations: EF Core migrations are applied at startup when a connection string is configured.
- Least privilege:
TeamsBotDbContextmaps only theteamsschema tables the service needs. It does not map the rest of the database that the API'sSpeContextcovers. - Secrets: the client secret is never stored.
CredentialRefis 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.jsonin the repo. - Keep the
DbContextleast-privilege; do not widen it to the API's full schema. - Treat
CredentialRefas a pointer, not a secret. Resolve it through the configured credential store. - The reserved webhook must not be enabled without Bot Framework JWT validation.