コンテンツにスキップ

Microsoft Teams

Microsoft Teams provider は digital worker を Teams の channel と chat に統合します。次をサポートします:

  • channel message
  • personal chat
  • group chat
  • Adaptive Cards
  • interactive component
  • file attachment
  • Microsoft 365 tenant
  • Azure AD への admin 権限
  1. Azure Bot Registration を作成する

    Azure Portal に移動します:

    • “Bot Services” を検索する
    • “Create” をクリックする
    • 詳細を入力する:
      • Bot handle: your-bot-name
      • Subscription: your subscription
      • Resource group: 作成または選択
      • Pricing: F0(free)または S1
    • “Create” をクリックする
  2. Bot Endpoint を設定する

    Bot Service で:

    • Configuration に移動する
    • Messaging endpoint を設定する: https://your-domain.com/webhook/teams/{tenant}/{team}
  3. App 認証情報を取得する

    Configuration で:

    • Microsoft App ID をコピーする
    • Microsoft App ID の横にある “Manage” をクリックする
    • 新しい Client Secret を作成する
    • secret value をコピーする(表示は 1 回だけです)
  4. Teams Channel を有効にする

    Bot Service で:

    • Channels に移動する
    • Microsoft Teams をクリックする
    • 規約に同意して有効にする
  5. Teams App Package を作成する

    Teams app 用の manifest を作成します:

    manifest.json
    {
    "$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.16/MicrosoftTeams.schema.json",
    "manifestVersion": "1.16",
    "version": "1.0.0",
    "id": "{{BOT_ID}}",
    "packageName": "com.yourcompany.supportbot",
    "developer": {
    "name": "Your Company",
    "websiteUrl": "https://yourcompany.com",
    "privacyUrl": "https://yourcompany.com/privacy",
    "termsOfUseUrl": "https://yourcompany.com/terms"
    },
    "name": {
    "short": "Support Bot",
    "full": "Support Bot for Customer Service"
    },
    "description": {
    "short": "Customer support assistant",
    "full": "AI-powered customer support assistant"
    },
    "icons": {
    "outline": "outline.png",
    "color": "color.png"
    },
    "accentColor": "#0078D4",
    "bots": [
    {
    "botId": "{{BOT_ID}}",
    "scopes": ["personal", "team", "groupchat"],
    "supportsFiles": true,
    "isNotificationOnly": false
    }
    ],
    "permissions": ["identity", "messageTeamMembers"],
    "validDomains": ["your-domain.com"]
    }
  6. provider を設定する

    answers.json
    {
    "messaging-teams": {
    "enabled": true,
    "public_base_url": "https://your-domain.ngrok-free.app",
    "app_id": "your-microsoft-app-id",
    "app_password": "your-client-secret",
    "tenant_id": "your-azure-tenant-id"
    }
    }
  7. セットアップを実行する

    Terminal window
    gtc setup --answers answers.json ./my-bundle
  8. Teams に App をインストールする

    • manifest.json と icon を zip にまとめる
    • Teams Admin Center に移動するか、直接 upload する
    • team または user にインストールする
OptionRequiredDescription
enabledYesprovider を有効/無効にする
public_base_urlYeswebhook 用の公開 URL
app_idYesMicrosoft App ID
app_passwordYesClient Secret
tenant_idNoAzure AD Tenant ID(single-tenant app 用)
- id: reply
type: reply
config:
message: "Hello! How can I help you today?"

Teams は Markdown の一部をサポートします:

- id: formatted
type: reply
config:
message: |
**Bold** *Italic*
- Bullet 1
- Bullet 2
[Link](https://example.com)

Teams は Adaptive Card を非常によくサポートしています:

- id: send_card
type: adaptive-card
config:
card:
type: AdaptiveCard
version: "1.4"
body:
- type: TextBlock
text: "Welcome!"
size: Large
weight: Bolder
- type: TextBlock
text: "How can I assist you today?"
- type: ActionSet
actions:
- type: Action.Submit
title: "Get Help"
data:
action: "help"
- type: Action.Submit
title: "Create Ticket"
data:
action: "ticket"
- id: hero_card
type: reply
config:
hero_card:
title: "Support Bot"
subtitle: "Your AI Assistant"
text: "I can help with technical issues, billing questions, and more."
images:
- url: "https://example.com/bot-image.png"
buttons:
- type: messageBack
title: "Get Started"
text: "get started"
displayText: "Getting started..."
- id: suggestions
type: reply
config:
message: "What would you like to do?"
suggested_actions:
- title: "Check Status"
value: "status"
- title: "Create Ticket"
value: "ticket"
- title: "Contact Human"
value: "human"
- id: send_file
type: reply
config:
message: "Here's your report"
attachments:
- contentType: "application/pdf"
contentUrl: "https://example.com/report.pdf"
name: "report.pdf"
flows/on_card_action.ygtc
name: handle_card_action
version: "1.0"
nodes:
- id: route_action
type: branch
config:
conditions:
- expression: "data.action == 'help'"
next: show_help
- expression: "data.action == 'ticket'"
next: create_ticket
default: unknown_action
- id: show_help
type: reply
config:
message: "Here's how I can help..."
triggers:
- type: invoke
name: "adaptiveCard/action"
target: route_action
greentic.demo.yaml
tenants:
demo:
teams:
support:
channels:
teams:
provider: messaging-teams
config:
team_id: "19:xxx@thread.tacv2"
channel_id: "19:yyy@thread.tacv2"

個人の 1:1 chat では channel 設定は不要です。bot はメッセージを送った相手に応答します。

user からの開始を待たずにメッセージを送信します:

- id: proactive
type: reply
config:
message: "Reminder: Your ticket #123 needs attention"
conversation_reference:
conversation_id: "{{stored_conversation_id}}"
service_url: "{{stored_service_url}}"
  1. Azure Bot Service の endpoint 設定 を確認する
  2. SSL certificate が有効であることを確認する
  3. app credentials が正しいことを確認する
  4. Azure の activity log を確認する
  • App ID と Password を確認する
  • single-tenant app の場合は tenant ID を確認する
  • bot が Teams channel で有効になっていることを確認する
  • Adaptive Cards Designer で card JSON を検証する
  • Teams がその card version をサポートしていることを確認する
  • 必須 field がすべて存在することを確認する
  • Teams では message がまとめて配送されることがあり、これは正常です
  • server の performance を確認する
  • rate limit が発生していないことを確認する

Greentic は次を自動検証します:

  • JWT signature
  • issuer と audience claim
  • token expiration