[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-e8b33524-75ed-4a9a-9a11-11036c8fa9ef":3,"$ft3sKwAlX7nghJdlwtvPx9DBKm7YZDqDufo-qbhXBy70":43},{"id":4,"title":5,"description":6,"categoryId":7,"moduleId":8,"tags":9,"prompt":10,"icon":11,"source":12,"sourceUrl":13,"authorId":14,"authorName":15,"isPublic":16,"stars":17,"runs":18,"createdAt":19,"updatedAt":19,"module":20,"category":27,"packages":34},"e8b33524-75ed-4a9a-9a11-11036c8fa9ef","azure-mgmt-botservice-py","Azure Bot服务管理SDK for Python。用于创建、管理和配置Azure Bot服务资源。","cat_coding_devops","mod_coding","sickn33,coding","---\nname: azure-mgmt-botservice-py\ndescription: Azure Bot Service Management SDK for Python. Use for creating, managing, and configuring Azure Bot Service resources.\nrisk: unknown\nsource: community\ndate_added: '2026-02-27'\n---\n\n# Azure Bot Service Management SDK for Python\n\nManage Azure Bot Service resources including bots, channels, and connections.\n\n## Installation\n\n```bash\npip install azure-mgmt-botservice\npip install azure-identity\n```\n\n## Environment Variables\n\n```bash\nAZURE_SUBSCRIPTION_ID=\u003Cyour-subscription-id>\nAZURE_RESOURCE_GROUP=\u003Cyour-resource-group>\n```\n\n## Authentication\n\n```python\nfrom azure.identity import DefaultAzureCredential\nfrom azure.mgmt.botservice import AzureBotService\nimport os\n\ncredential = DefaultAzureCredential()\nclient = AzureBotService(\n    credential=credential,\n    subscription_id=os.environ[\"AZURE_SUBSCRIPTION_ID\"]\n)\n```\n\n## Create a Bot\n\n```python\nfrom azure.mgmt.botservice import AzureBotService\nfrom azure.mgmt.botservice.models import Bot, BotProperties, Sku\nfrom azure.identity import DefaultAzureCredential\nimport os\n\ncredential = DefaultAzureCredential()\nclient = AzureBotService(\n    credential=credential,\n    subscription_id=os.environ[\"AZURE_SUBSCRIPTION_ID\"]\n)\n\nresource_group = os.environ[\"AZURE_RESOURCE_GROUP\"]\nbot_name = \"my-chat-bot\"\n\nbot = client.bots.create(\n    resource_group_name=resource_group,\n    resource_name=bot_name,\n    parameters=Bot(\n        location=\"global\",\n        sku=Sku(name=\"F0\"),  # Free tier\n        kind=\"azurebot\",\n        properties=BotProperties(\n            display_name=\"My Chat Bot\",\n            description=\"A conversational AI bot\",\n            endpoint=\"https:\u002F\u002Fmy-bot-app.azurewebsites.net\u002Fapi\u002Fmessages\",\n            msa_app_id=\"\u003Cyour-app-id>\",\n            msa_app_type=\"MultiTenant\"\n        )\n    )\n)\n\nprint(f\"Bot created: {bot.name}\")\n```\n\n## Get Bot Details\n\n```python\nbot = client.bots.get(\n    resource_group_name=resource_group,\n    resource_name=bot_name\n)\n\nprint(f\"Bot: {bot.properties.display_name}\")\nprint(f\"Endpoint: {bot.properties.endpoint}\")\nprint(f\"SKU: {bot.sku.name}\")\n```\n\n## List Bots in Resource Group\n\n```python\nbots = client.bots.list_by_resource_group(resource_group_name=resource_group)\n\nfor bot in bots:\n    print(f\"Bot: {bot.name} - {bot.properties.display_name}\")\n```\n\n## List All Bots in Subscription\n\n```python\nall_bots = client.bots.list()\n\nfor bot in all_bots:\n    print(f\"Bot: {bot.name} in {bot.id.split('\u002F')[4]}\")\n```\n\n## Update Bot\n\n```python\nbot = client.bots.update(\n    resource_group_name=resource_group,\n    resource_name=bot_name,\n    properties=BotProperties(\n        display_name=\"Updated Bot Name\",\n        description=\"Updated description\"\n    )\n)\n```\n\n## Delete Bot\n\n```python\nclient.bots.delete(\n    resource_group_name=resource_group,\n    resource_name=bot_name\n)\n```\n\n## Configure Channels\n\n### Add Teams Channel\n\n```python\nfrom azure.mgmt.botservice.models import (\n    BotChannel,\n    MsTeamsChannel,\n    MsTeamsChannelProperties\n)\n\nchannel = client.channels.create(\n    resource_group_name=resource_group,\n    resource_name=bot_name,\n    channel_name=\"MsTeamsChannel\",\n    parameters=BotChannel(\n        location=\"global\",\n        properties=MsTeamsChannel(\n            properties=MsTeamsChannelProperties(\n                is_enabled=True\n            )\n        )\n    )\n)\n```\n\n### Add Direct Line Channel\n\n```python\nfrom azure.mgmt.botservice.models import (\n    BotChannel,\n    DirectLineChannel,\n    DirectLineChannelProperties,\n    DirectLineSite\n)\n\nchannel = client.channels.create(\n    resource_group_name=resource_group,\n    resource_name=bot_name,\n    channel_name=\"DirectLineChannel\",\n    parameters=BotChannel(\n        location=\"global\",\n        properties=DirectLineChannel(\n            properties=DirectLineChannelProperties(\n                sites=[\n                    DirectLineSite(\n                        site_name=\"Default Site\",\n                        is_enabled=True,\n                        is_v1_enabled=False,\n                        is_v3_enabled=True\n                    )\n                ]\n            )\n        )\n    )\n)\n```\n\n### Add Web Chat Channel\n\n```python\nfrom azure.mgmt.botservice.models import (\n    BotChannel,\n    WebChatChannel,\n    WebChatChannelProperties,\n    WebChatSite\n)\n\nchannel = client.channels.create(\n    resource_group_name=resource_group,\n    resource_name=bot_name,\n    channel_name=\"WebChatChannel\",\n    parameters=BotChannel(\n        location=\"global\",\n        properties=WebChatChannel(\n            properties=WebChatChannelProperties(\n                sites=[\n                    WebChatSite(\n                        site_name=\"Default Site\",\n                        is_enabled=True\n                    )\n                ]\n            )\n        )\n    )\n)\n```\n\n## Get Channel Details\n\n```python\nchannel = client.channels.get(\n    resource_group_name=resource_group,\n    resource_name=bot_name,\n    channel_name=\"DirectLineChannel\"\n)\n```\n\n## List Channel Keys\n\n```python\nkeys = client.channels.list_with_keys(\n    resource_group_name=resource_group,\n    resource_name=bot_name,\n    channel_name=\"DirectLineChannel\"\n)\n\n# Access Direct Line keys\nif hasattr(keys.properties, 'properties'):\n    for site in keys.properties.properties.sites:\n        print(f\"Site: {site.site_name}\")\n        print(f\"Key: {site.key}\")\n```\n\n## Bot Connections (OAuth)\n\n### Create Connection Setting\n\n```python\nfrom azure.mgmt.botservice.models import (\n    ConnectionSetting,\n    ConnectionSettingProperties\n)\n\nconnection = client.bot_connection.create(\n    resource_group_name=resource_group,\n    resource_name=bot_name,\n    connection_name=\"graph-connection\",\n    parameters=ConnectionSetting(\n        location=\"global\",\n        properties=ConnectionSettingProperties(\n            client_id=\"\u003Coauth-client-id>\",\n            client_secret=\"\u003Coauth-client-secret>\",\n            scopes=\"User.Read\",\n            service_provider_id=\"\u003Cservice-provider-id>\"\n        )\n    )\n)\n```\n\n### List Connections\n\n```python\nconnections = client.bot_connection.list_by_bot_service(\n    resource_group_name=resource_group,\n    resource_name=bot_name\n)\n\nfor conn in connections:\n    print(f\"Connection: {conn.name}\")\n```\n\n## Client Operations\n\n| Operation | Method |\n|-----------|--------|\n| `client.bots` | Bot CRUD operations |\n| `client.channels` | Channel configuration |\n| `client.bot_connection` | OAuth connection settings |\n| `client.direct_line` | Direct Line channel operations |\n| `client.email` | Email channel operations |\n| `client.operations` | Available operations |\n| `client.host_settings` | Host settings operations |\n\n## SKU Options\n\n| SKU | Description |\n|-----|-------------|\n| `F0` | Free tier (limited messages) |\n| `S1` | Standard tier (unlimited messages) |\n\n## Channel Types\n\n| Channel | Class | Purpose |\n|---------|-------|---------|\n| `MsTeamsChannel` | Microsoft Teams | Teams integration |\n| `DirectLineChannel` | Direct Line | Custom client integration |\n| `WebChatChannel` | Web Chat | Embeddable web widget |\n| `SlackChannel` | Slack | Slack workspace integration |\n| `FacebookChannel` | Facebook | Messenger integration |\n| `EmailChannel` | Email | Email communication |\n\n## Best Practices\n\n1. **Use DefaultAzureCredential** for authentication\n2. **Start with F0 SKU** for development, upgrade to S1 for production\n3. **Store MSA App ID\u002FSecret securely** — use Key Vault\n4. **Enable only needed channels** — reduces attack surface\n5. **Rotate Direct Line keys** periodically\n6. **Use managed identity** when possible for bot connections\n7. **Configure proper CORS** for Web Chat channel\n\n## When to Use\nThis skill is applicable to execute the workflow or actions described in the overview.\n\n## Limitations\n- Use this skill only when the task clearly matches the scope described above.\n- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.\n- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.\n","","imported","https:\u002F\u002Fgithub.com\u002Fsickn33\u002Fantigravity-awesome-skills","user_system_seed","SkillOPIC",true,148,1175,"2026-05-16 13:07:02",{"id":8,"name":21,"slug":22,"icon":23,"description":24,"sort":25,"createdAt":26},"编程开发","coding","mdi-code-braces","代码生成、调试、审查，提升开发效率",2,"2026-05-16 12:53:40",{"id":7,"name":28,"slug":29,"icon":30,"description":31,"moduleId":8,"sort":32,"skillCount":33,"createdAt":26},"DevOps","devops","mdi-cog-outline","CI\u002FCD、容器化、部署运维",3,162,[35],{"id":36,"skillId":4,"version":37,"fileName":38,"fileSize":39,"filePath":40,"fileHash":41,"manifest":42,"createdAt":19},"384b40be-d5e0-4192-b583-3e12706b02f1","1.0.0","azure-mgmt-botservice-py.zip",2348,"uploads\u002Fskills\u002Fe8b33524-75ed-4a9a-9a11-11036c8fa9ef\u002Fazure-mgmt-botservice-py.zip","40f7048c35e6f417d021bcfccb1ae242d37bc8a19a178c83db00552b8d35709d","[{\"path\":\"SKILL.md\",\"isDirectory\":false,\"size\":8009}]",{"code":44,"message":45,"data":46},200,"success",{"items":47,"stats":48,"page":51},[],{"averageRating":49,"totalRatings":49,"ratingCounts":50},0,[49,49,49,49,49],{"limit":52,"offset":49,"hasMore":53,"nextOffset":52,"ratedOnly":16},15,false]