Install & Compatibility
Where this runs
tested against v4.17.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 45.1MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 3.8s · import 0.000s · 45MB
44MB installed
● package 44MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
ConnectorClient
✓ from botframework.connector import ConnectorClient
✗ from botframework.connector import ConnectorClient
This example demonstrates how to use `botframework-connector` to directly send an activity (a 'Hello World' message) to a user in a specific channel. It initializes a `ConnectorClient` with Microsoft App Credentials (typically set via environment variables) and then creates a conversation to send a message. This library focuses on the low-level interaction with the Bot Connector Service, primarily for proactive messaging or direct API calls.
import os
from botbuilder.schema import Activity, ActivityTypes, ChannelAccount, ConversationParameters
from botframework.connector import ConnectorClient
from botframework.connector.auth import MicrosoftAppCredentials
APP_ID = os.environ.get("MicrosoftAppId", "")
APP_PASSWORD = os.environ.get("MicrosoftAppPassword", "")
SERVICE_URL = os.environ.get("BotServiceUrl", "https://slack.botframework.com") # Replace with your bot's service URL
CHANNEL_ID = os.environ.get("ChannelId", "slack") # Example channel ID, replace as needed
BOT_ID = os.environ.get("BotId", "your_bot_id") # Replace with your bot's ID
RECIPIENT_ID = os.environ.get("RecipientId", "user_id") # Replace with the recipient's user ID
if not APP_ID or not APP_PASSWORD:
print("WARNING: MicrosoftAppId and MicrosoftAppPassword environment variables not set. Authentication might fail for production scenarios.")
try:
credentials = MicrosoftAppCredentials(APP_ID, APP_PASSWORD)
connector = ConnectorClient(credentials, base_url=SERVICE_URL)
conversation_parameters = ConversationParameters(
is_group=False,
bot=ChannelAccount(id=BOT_ID),
members=[ChannelAccount(id=RECIPIENT_ID)],
# channel_data={"tenantId": "your_tenant_id"} # Optional: Add tenant ID for Teams, etc. if needed
)
conversation = connector.conversations.create_conversation(conversation_parameters)
activity = Activity(
type=ActivityTypes.message,
channel_id=CHANNEL_ID,
recipient=ChannelAccount(id=RECIPIENT_ID),
from_property=ChannelAccount(id=BOT_ID),
text='Hello World from botframework-connector!'
)
response = connector.conversations.send_to_conversation(conversation.id, activity)
print(f"Message sent. Activity ID: {response.id}")
except Exception as e:
print(f"An error occurred: {e}")
print("Ensure APP_ID, APP_PASSWORD, SERVICE_URL, BOT_ID, RECIPIENT_ID are correctly configured and accessible.")
Debug
Known issues
breakingThe Bot Framework Python SDK, including `botframework-connector`, has reached its End-of-Life (EOL) with version 4.17.1. It will no longer receive updates, maintenance, or support through Azure portal service tickets.fixMigrate to the Microsoft 365 Agents SDK or another supported framework for new development. Existing bots will continue to function but without official support or updates. Support tickets will no longer be serviced as of December 31, 2025.
affects: 4.17.1 and later
breakingBeginning with SDK version 4.15.0, `aiohttp` package version 3.9+ (a core dependency) now requires Python 3.8 or newer. Bots running on Python 3.7 or earlier will encounter compatibility issues.fixUpgrade your Python environment to Python 3.8 or a newer compatible version. This includes updating the Python version in your Azure App Service if deployed.
affects: 4.15.0 and later
gotchaProper authentication using `MicrosoftAppId` and `MicrosoftAppPassword` is critical for production bots. Misconfiguration or absence of these credentials will prevent your bot from communicating with the Bot Connector Service.fixAlways set `MicrosoftAppId` and `MicrosoftAppPassword` as environment variables for your bot. For local development, these might be optional for some configurations, but they are mandatory for production deployments.
affects: All versions
gotchaThe `botframework-connector` library is typically used for low-level interactions with the Bot Connector Service, such as sending proactive messages. For a complete bot experience (handling incoming activities, managing turn context, dialogs), you would usually integrate it with `botbuilder-core` and its `BotFrameworkAdapter`.fixUnderstand the scope of `botframework-connector`. If building a complete conversational bot, combine it with `botbuilder-core` components to handle the full lifecycle of a conversation.
affects: All versions
Upgrade
Version history
4.17.1latest on PyPI · released Jan 5, 2026
Audit
Dependencies
botbuilder-schemarequiredProvides the core schema definitions for bot activities and objects.
msalrequiredMicrosoft Authentication Library for handling authentication with Microsoft services.
msrestrequiredMicrosoft REST client runtime for interacting with RESTful APIs.
pyjwtrequiredUsed for JSON Web Token (JWT) handling, essential for authentication.