{"id":1928,"library":"azure-mgmt-botservice","title":"Microsoft Azure Bot Service Client Library for Python","description":"The azure-mgmt-botservice library provides the Python SDK for programmatically managing Azure Bot Service resources. It enables the creation, update, retrieval, and deletion of bots, channels, connections, SKUs, and properties. It utilizes the modern Azure SDK guidelines, including `azure-identity` for authentication. The current stable version is 2.0.0, and it follows the typical Azure SDK release cadence.","status":"active","version":"2.0.0","language":"en","source_language":"en","source_url":"https://github.com/Azure/azure-sdk-for-python","tags":["azure","bot service","management","cloud","sdk","automation"],"install":[{"cmd":"pip install azure-mgmt-botservice azure-identity","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Required for authenticating with Azure services using modern Azure SDK clients.","package":"azure-identity","optional":false}],"imports":[{"note":"The main client class is directly available under `azure.mgmt.botservice`.","wrong":"from azure.mgmt.botservice.azure_bot_service import AzureBotService","symbol":"AzureBotService","correct":"from azure.mgmt.botservice import AzureBotService"},{"note":"Modern Azure SDKs use `azure-identity` for authentication, replacing older credential types.","wrong":"from azure.common.credentials import ServicePrincipalCredentials","symbol":"DefaultAzureCredential","correct":"from azure.identity import DefaultAzureCredential"}],"quickstart":{"code":"import os\nfrom azure.identity import DefaultAzureCredential\nfrom azure.mgmt.botservice import AzureBotService\n\n# Set environment variables or replace with your actual values\n# AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET, AZURE_SUBSCRIPTION_ID\n\nsubscription_id = os.environ.get('AZURE_SUBSCRIPTION_ID', 'YOUR_SUBSCRIPTION_ID')\nresource_group_name = os.environ.get('AZURE_RESOURCE_GROUP', 'YOUR_RESOURCE_GROUP_NAME')\nbot_name = os.environ.get('AZURE_BOT_NAME', 'YOUR_BOT_NAME')\n\nif subscription_id == 'YOUR_SUBSCRIPTION_ID' or resource_group_name == 'YOUR_RESOURCE_GROUP_NAME' or bot_name == 'YOUR_BOT_NAME':\n    raise ValueError(\"Please set AZURE_SUBSCRIPTION_ID, AZURE_RESOURCE_GROUP, and AZURE_BOT_NAME environment variables or replace placeholders.\")\n\n# Authenticate using DefaultAzureCredential\ncredential = DefaultAzureCredential()\n\n# Create a Bot Service management client\nclient = AzureBotService(credential=credential, subscription_id=subscription_id)\n\n# Example: List bots in a resource group\ntry:\n    print(f\"Listing bots in resource group '{resource_group_name}':\")\n    bots = client.bots.list_by_resource_group(resource_group_name)\n    for bot in bots:\n        print(f\"  Bot Name: {bot.name}, Location: {bot.location}\")\nexcept Exception as e:\n    print(f\"Error listing bots: {e}\")","lang":"python","description":"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."},"warnings":[{"fix":"Migrate to `azure-identity` for authentication. Use classes like `DefaultAzureCredential` and pass them via the `credential` parameter to the `AzureBotService` client.","message":"The 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`.","severity":"breaking","affected_versions":"All versions >= 1.0.0b1 (and current 2.x.x)"},{"fix":"Update long-running operation (LRO) calls to use the `begin_` prefix and handle the `azure.core.polling.LROPoller` object.","message":"As 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`).","severity":"breaking","affected_versions":"All versions >= 1.0.0b1 (and current 2.x.x)"},{"fix":"Update exception handling blocks to catch `azure.core.exceptions.HttpResponseError` instead of `CloudError` or other older exception types.","message":"The exception hierarchy has been simplified. Most exceptions now inherit from `azure.core.exceptions.HttpResponseError`. The older `CloudError` has been removed.","severity":"breaking","affected_versions":"All versions >= 1.0.0b1 (and current 2.x.x)"},{"fix":"Plan 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.","message":"Multi-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.","severity":"deprecated","affected_versions":"Service-side deprecation affecting usage of the library for new multi-tenant bots."},{"fix":"Ensure your development and deployment environments use Python 3.7+ to avoid compatibility issues and ensure security updates.","message":"Python 2.7 support for Azure SDK Python packages ended on January 1, 2022. This library requires Python 3.7 or newer.","severity":"gotcha","affected_versions":"<= 1.0.0b1 (previous generation libraries)"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}