Microsoft Teams Common Library
raw JSON → 2.0.0 verified Sat May 09 auth: no python
Common package for building Microsoft Teams bots and apps in Python. Provides shared models, utilities, and middleware. Current stable version is 2.0.0, released June 2025. The library is under active development with alpha pre-releases on the v2.0.0 track.
pip install microsoft-teams-common Common errors
error ModuleNotFoundError: No module named 'microsoft.teams' ↓
cause Importing using deprecated dot notation.
fix
Use
from microsoft_teams.common import MicrosoftTeamsCommon. error ImportError: cannot import name 'HttpPlugin' from 'microsoft_teams.common' ↓
cause HttpPlugin was removed in v2.0.0a20.
fix
Use
HttpServer and HttpServerAdapter instead. Warnings
breaking Namespace changed from `microsoft.teams.*` to `microsoft_teams.*` in v2.0.0a8 and later. Imports using dots will break. ↓
fix Change all imports from `microsoft.teams.common` to `microsoft_teams.common`.
breaking In v2.0.0a20, HttpPlugin was replaced with HttpServer + HttpServerAdapter. Old code using HttpPlugin will not work. ↓
fix Replace HttpPlugin with HttpServer and HttpServerAdapter as per migration guide.
deprecated Support for Python <3.12 dropped as of v2.0.0. Requires Python >=3.12 and <3.15. ↓
fix Upgrade to Python 3.12 or later.
breaking IsTargeted property moved from Activity class to Account class in v2.0.0a20. ↓
fix Access IsTargeted via Account object instead of Activity.
breaking Remove custom logger, use standard logging library (v2.0.0a20). ↓
fix Replace custom logger imports with Python's standard logging module.
Imports
- MicrosoftTeamsCommon wrong
from microsoft.teams.common import MicrosoftTeamsCommoncorrectfrom microsoft_teams.common import MicrosoftTeamsCommon
Quickstart
import os
from microsoft_teams.common import MicrosoftTeamsCommon
# Initialize common client with optional configuration
client = MicrosoftTeamsCommon(
app_id=os.environ.get('TEAMS_APP_ID', ''),
app_password=os.environ.get('TEAMS_APP_PASSWORD', ''),
)
print('Common client initialized successfully.')