Install & Compatibility
Where this runs
tested against v2.0.0 · 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.970s · 46.7MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 4.2s · import 0.920s · 47MB
46MB installed
● package 46MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
AzureBotService
✓ from azure.mgmt.botservice import AzureBotService
✗ from azure.mgmt.botservice.azure_bot_service import AzureBotService
The main client class is directly available under `azure.mgmt.botservice`.
DefaultAzureCredential
✓ from azure.identity import DefaultAzureCredential
✗ from azure.common.credentials import ServicePrincipalCredentials
Modern Azure SDKs use `azure-identity` for authentication, replacing older credential types.
This quickstart demonstrates how to authenticate with Azure using `DefaultAzureCredential` and list Bot Service resources within a specified resource group. Ensure `AZURE_SUBSCRIPTION_ID`, `AZURE_RESOURCE_GROUP`, and `AZURE_BOT_NAME` environment variables are set for successful authentication and execution.
import os
from azure.identity import DefaultAzureCredential
from azure.mgmt.botservice import AzureBotService
# Set environment variables or replace with your actual values
# AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET, AZURE_SUBSCRIPTION_ID
subscription_id = os.environ.get('AZURE_SUBSCRIPTION_ID', 'YOUR_SUBSCRIPTION_ID')
resource_group_name = os.environ.get('AZURE_RESOURCE_GROUP', 'YOUR_RESOURCE_GROUP_NAME')
bot_name = os.environ.get('AZURE_BOT_NAME', 'YOUR_BOT_NAME')
if subscription_id == 'YOUR_SUBSCRIPTION_ID' or resource_group_name == 'YOUR_RESOURCE_GROUP_NAME' or bot_name == 'YOUR_BOT_NAME':
raise ValueError("Please set AZURE_SUBSCRIPTION_ID, AZURE_RESOURCE_GROUP, and AZURE_BOT_NAME environment variables or replace placeholders.")
# Authenticate using DefaultAzureCredential
credential = DefaultAzureCredential()
# Create a Bot Service management client
client = AzureBotService(credential=credential, subscription_id=subscription_id)
# Example: List bots in a resource group
try:
print(f"Listing bots in resource group '{resource_group_name}':")
bots = client.bots.list_by_resource_group(resource_group_name)
for bot in bots:
print(f" Bot Name: {bot.name}, Location: {bot.location}")
except Exception as e:
print(f"Error listing bots: {e}")
Debug
Known issues
breakingThe credential system has been completely revamped. Older authentication methods like `azure.common.credentials` or `msrestazure.azure_active_directory` are no longer supported. The `credentials` parameter on client constructors has been renamed to `credential`.fixMigrate to `azure-identity` for authentication. Use classes like `DefaultAzureCredential` and pass them via the `credential` parameter to the `AzureBotService` client.
affects: All versions >= 1.0.0b1 (and current 2.x.x)
breakingAs part of the unified Azure SDK guidelines, operations that previously returned `msrest.polling.LROPoller` now return `azure.core.polling.LROPoller` and are typically prefixed with `begin_` (e.g., `create_bot` might become `begin_create_bot`).fixUpdate long-running operation (LRO) calls to use the `begin_` prefix and handle the `azure.core.polling.LROPoller` object.
affects: All versions >= 1.0.0b1 (and current 2.x.x)
breakingThe exception hierarchy has been simplified. Most exceptions now inherit from `azure.core.exceptions.HttpResponseError`. The older `CloudError` has been removed.fixUpdate exception handling blocks to catch `azure.core.exceptions.HttpResponseError` instead of `CloudError` or other older exception types.
affects: All versions >= 1.0.0b1 (and current 2.x.x)
deprecatedMulti-tenant bot creation will be deprecated after July 31, 2025. This impacts how new bots configured for multi-tenancy can be registered or created using the Azure Bot Service.fixPlan to migrate existing multi-tenant bots or create new bots using single-tenant application types where possible, as supported by the Bot Framework SDKs. Refer to Azure Bot Service documentation for up-to-date guidance on bot registration and identity management.
affects: Service-side deprecation affecting usage of the library for new multi-tenant bots.
gotchaPython 2.7 support for Azure SDK Python packages ended on January 1, 2022. This library requires Python 3.7 or newer.fixEnsure your development and deployment environments use Python 3.7+ to avoid compatibility issues and ensure security updates.
affects: <= 1.0.0b1 (previous generation libraries)
Upgrade
Version history
2.0.0latest on PyPI · released Jan 17, 2023
Audit
Dependencies
azure-identityrequiredRequired for authenticating with Azure services using modern Azure SDK clients.