azure-mgmt-botservice-py – skill DevOps & Hạ tầng cho agent AI
SDK quản lý Azure Bot Service cho Python. Dùng để tạo, quản lý và cấu hình tài nguyên Azure Bot Service.
Cài skill azure-mgmt-botservice-py bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/azure-mgmt-botservice-py-fca4d.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /azure-mgmt-botservice-py – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/azure-mgmt-botservice-py-fca4d.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $azure-mgmt-botservice-py – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/azure-mgmt-botservice-py-fca4d.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /azure-mgmt-botservice-py – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/azure-mgmt-botservice-py-fca4d.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /azure-mgmt-botservice-py – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
Azure Bot Service Management SDK for Python
Manage Azure Bot Service resources including bots, channels, and connections.
Installation
pip install azure-mgmt-botservice
pip install azure-identityEnvironment Variables
AZURE_SUBSCRIPTION_ID=<your-subscription-id>
AZURE_RESOURCE_GROUP=<your-resource-group>Authentication
from azure.identity import DefaultAzureCredential
from azure.mgmt.botservice import AzureBotService
import os
credential = DefaultAzureCredential()
client = AzureBotService(
credential=credential,
subscription_id=os.environ["AZURE_SUBSCRIPTION_ID"]
)Create a Bot
from azure.mgmt.botservice import AzureBotService
from azure.mgmt.botservice.models import Bot, BotProperties, Sku
from azure.identity import DefaultAzureCredential
import os
credential = DefaultAzureCredential()
client = AzureBotService(
credential=credential,
subscription_id=os.environ["AZURE_SUBSCRIPTION_ID"]
)
resource_group = os.environ["AZURE_RESOURCE_GROUP"]
bot_name = "my-chat-bot"
bot = client.bots.create(
resource_group_name=resource_group,
resource_name=bot_name,
parameters=Bot(
location="global",
sku=Sku(name="F0"), # Free tier
kind="azurebot",
properties=BotProperties(
display_name="My Chat Bot",
description="A conversational AI bot",
endpoint="https://my-bot-app.azurewebsites.net/api/messages",
msa_app_id="<your-app-id>",
msa_app_type="MultiTenant"
)
)
)
print(f"Bot created: {bot.name}")Get Bot Details
bot = client.bots.get(
resource_group_name=resource_group,
resource_name=bot_name
)
print(f"Bot: {bot.properties.display_name}")
print(f"Endpoint: {bot.properties.endpoint}")
print(f"SKU: {bot.sku.name}")List Bots in Resource Group
bots = client.bots.list_by_resource_group(resource_group_name=resource_group)
for bot in bots:
print(f"Bot: {bot.name} - {bot.properties.display_name}")List All Bots in Subscription
all_bots = client.bots.list()
for bot in all_bots:
print(f"Bot: {bot.name} in {bot.id.split('/')[4]}")Update Bot
bot = client.bots.update(
resource_group_name=resource_group,
resource_name=bot_name,
properties=BotProperties(
display_name="Updated Bot Name",
description="Updated description"
)
)Delete Bot
client.bots.delete(
resource_group_name=resource_group,
resource_name=bot_name
)Configure Channels
Add Teams Channel
from azure.mgmt.botservice.models import (
BotChannel,
MsTeamsChannel,
MsTeamsChannelProperties
)
channel = client.channels.create(
resource_group_name=resource_group,
resource_name=bot_name,
channel_name="MsTeamsChannel",
parameters=BotChannel(
location="global",
properties=MsTeamsChannel(
properties=MsTeamsChannelProperties(
is_enabled=True
)
)
)
)Add Direct Line Channel
from azure.mgmt.botservice.models import (
BotChannel,
DirectLineChannel,
DirectLineChannelProperties,
DirectLineSite
)
channel = client.channels.create(
resource_group_name=resource_group,
resource_name=bot_name,
channel_name="DirectLineChannel",
parameters=BotChannel(
location="global",
properties=DirectLineChannel(
properties=DirectLineChannelProperties(
sites=[
DirectLineSite(
site_name="Default Site",
is_enabled=True,
is_v1_enabled=False,
is_v3_enabled=True
)
]
)
)
)
)Add Web Chat Channel
from azure.mgmt.botservice.models import (
BotChannel,
WebChatChannel,
WebChatChannelProperties,
WebChatSite
)
channel = client.channels.create(
resource_group_name=resource_group,
resource_name=bot_name,
channel_name="WebChatChannel",
parameters=BotChannel(
location="global",
properties=WebChatChannel(
properties=WebChatChannelProperties(
sites=[
WebChatSite(
site_name="Default Site",
is_enabled=True
)
]
)
)
)
)Get Channel Details
channel = client.channels.get(
resource_group_name=resource_group,
resource_name=bot_name,
channel_name="DirectLineChannel"
)List Channel Keys
keys = client.channels.list_with_keys(
resource_group_name=resource_group,
resource_name=bot_name,
channel_name="DirectLineChannel"
)
# Access Direct Line keys
if hasattr(keys.properties, 'properties'):
for site in keys.properties.properties.sites:
print(f"Site: {site.site_name}")
# Do not print Direct Line keys; store only in approved secret storage.Bot Connections (OAuth)
Create Connection Setting
import os
from azure.mgmt.botservice.models import (
ConnectionSetting,
ConnectionSettingProperties
)
connection = client.bot_connection.create(
resource_group_name=resource_group,
resource_name=bot_name,
connection_name="graph-connection",
parameters=ConnectionSetting(
location="global",
properties=ConnectionSettingProperties(
client_id="<oauth-client-id>",
client_secret=os.environ["BOT_OAUTH_CLIENT_SECRET"],
scopes="User.Read",
service_provider_id="<service-provider-id>"
)
)
)List Connections
connections = client.bot_connection.list_by_bot_service(
resource_group_name=resource_group,
resource_name=bot_name
)
for conn in connections:
print(f"Connection: {conn.name}")Client Operations
| Operation | Method |
|-----------|--------|
| client.bots | Bot CRUD operations |
| client.channels | Channel configuration |
| client.bot_connection | OAuth connection settings |
| client.direct_line | Direct Line channel operations |
| client.email | Email channel operations |
| client.operations | Available operations |
| client.host_settings | Host settings operations |
SKU Options
| SKU | Description |
|-----|-------------|
| F0 | Free tier (limited messages) |
| S1 | Standard tier (unlimited messages) |
Channel Types
| Channel | Class | Purpose |
|---------|-------|---------|
| MsTeamsChannel | Microsoft Teams | Teams integration |
| DirectLineChannel | Direct Line | Custom client integration |
| WebChatChannel | Web Chat | Embeddable web widget |
| SlackChannel | Slack | Slack workspace integration |
| FacebookChannel | Facebook | Messenger integration |
| EmailChannel | Email | Email communication |
Best Practices
1. Use DefaultAzureCredential for authentication
2. Start with F0 SKU for development, upgrade to S1 for production
3. Store MSA App ID/Secret securely — use Key Vault
4. Enable only needed channels — reduces attack surface
5. Rotate Direct Line keys periodically
6. Use managed identity when possible for bot connections
7. Configure proper CORS for Web Chat channel
When to Use
This skill is applicable to execute the workflow or actions described in the overview.
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
Management examples create/change real resources and channels: confirm subscription, resource group, bot/channel IDs and intended diff. Verify current supported identity/app types and channel/API versions before registering a new bot; a historical MultiTenant example does not establish current registration eligibility. F0 is a tier name, not a promise that every integration/channel is cost-free. Do not log channel keys or full management responses.
Skill liên quan
- azure-mgmt-fabric-dotnet – SDK Azure Resource Manager cho Fabric trong .NET.
- azure-mgmt-fabric-py – SDK quản lý Azure Fabric cho Python. Dùng để quản lý dung lượng và tài nguyên Microsoft…
- azure-mgmt-mongodbatlas-dotnet – Quản lý tổ chức MongoDB Atlas như tài nguyên ARM của Azure, với thanh toán hợp nhất qua…
- azure-mgmt-weightsandbiases-dotnet – SDK Azure Weights & Biases cho .NET. Theo dõi thí nghiệm ML và quản lý mô hình qua Azure…
- mtls-configuration – Cấu hình mutual TLS (mTLS) cho giao tiếp zero-trust giữa các dịch vụ. Dùng khi triển…
- multi-cloud-architecture – Thiết kế kiến trúc multi-cloud bằng khung quyết định để chọn và tích hợp dịch vụ trên…
- azure-microsoft-playwright-testing-ts – Chạy test Playwright ở quy mô lớn với trình duyệt đám mây và báo cáo tích hợp trên Azure…
- azure-monitor-audit – Cấu hình Azure Monitor và Activity Log để kiểm toán. Thiết lập diagnostic settings và…