Skip to content

fix(teams): support single-tenant bots via TEAMS_APP_TENANT_ID env var#2928

Open
xodn348 wants to merge 1 commit into
Chainlit:mainfrom
xodn348:fix/teams-single-tenant
Open

fix(teams): support single-tenant bots via TEAMS_APP_TENANT_ID env var#2928
xodn348 wants to merge 1 commit into
Chainlit:mainfrom
xodn348:fix/teams-single-tenant

Conversation

@xodn348
Copy link
Copy Markdown

@xodn348 xodn348 commented May 18, 2026

Summary

  • BotFrameworkAdapterSettings now receives channel_auth_tenant from the TEAMS_APP_TENANT_ID environment variable, enabling single-tenant Azure Bot registrations.
  • When TEAMS_APP_TENANT_ID is unset the value is None, preserving the existing multi-tenant behaviour.
  • Two new unit tests cover both code paths (with and without tenant id).

Related issue

Closes #2919MS Teams integration supports only deprecated multi tenant bots

Local verification

=== LOCAL_TEST_PASSED ===
$ cd backend && CYPRESS_INSTALL_BINARY=0 uv sync --extra tests
$ uv run pytest tests/test_teams_adapter.py -v
PASSED tests/test_teams_adapter.py::test_teams_adapter_without_tenant
PASSED tests/test_teams_adapter.py::test_teams_adapter_with_tenant
2 passed in 0.35s
$ uv run ruff check chainlit/teams/app.py tests/test_teams_adapter.py
All checks passed!
$ uv run ruff format --check chainlit/teams/app.py tests/test_teams_adapter.py
All checks passed!

Risk

Low. One-line change; the new parameter is optional and defaults to None (same as the previous implicit default). No behaviour change for existing multi-tenant deployments.


Summary by cubic

Enable single-tenant Microsoft Teams bots by wiring TEAMS_APP_TENANT_ID to BotFrameworkAdapterSettings.channel_auth_tenant (closes #2919). When unset, behavior stays multi-tenant; tests cover both paths.

Written for commit 1c86d64. Summary will update on new commits. Review in cubic

@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. backend Pertains to the Python backend. enhancement New feature or request unit-tests Has unit tests. labels May 18, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Re-trigger cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Pertains to the Python backend. enhancement New feature or request size:XS This PR changes 0-9 lines, ignoring generated files. unit-tests Has unit tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MS Teams integration supports only deprecated multi tenant bots

1 participant