Skip to content

Microsoft Teams

The Microsoft Teams provider integrates your digital worker with Teams channels and chats. It supports:

  • Channel messages
  • Personal chats
  • Group chats
  • Adaptive Cards
  • Interactive components
  • File attachments
  • Microsoft 365 tenant
  • A public Microsoft Entra application client id that supports device-code OAuth
  • Permission to grant or consent to the Graph scopes used by setup
  • Permission to create channels in the selected Team when you want setup to create a missing desired channel

Teams setup has two supported configuration shapes:

ModeUse this whenMain fields
Graph channel modeYou want Graph-based channel sends and subscriptions. This is the default setup mode.tenant_id, client_id, team_id, team_name, channel_id, channel_name, desired_channel_name
Bot Framework modeYou have an Azure Bot and Teams app manifest for inbound Bot Framework messages.ms_bot_app_id, ms_bot_app_password, bot_display_name, messaging_endpoint
  1. Configure the setup hint

    You can run setup with only the default public client id, or provide your own client_id. Add desired_channel_name when you want setup to find or create a specific standard channel:

    answers.json
    {
    "setup_answers": {
    "messaging-teams": {
    "client_id": "6c115a7a-f656-49c4-975a-5e831efae833",
    "desired_channel_name": "hr onboarding"
    }
    }
    }
  2. Start Teams setup

    Terminal window
    gtc setup --answers answers.json ./my-bundle
  3. Complete device-code OAuth

    Setup starts a Microsoft device-code flow. Copy the code, open the verification URL, sign in with the Microsoft 365 account that can access the target Team, and approve the requested Graph scopes.

    Return to the terminal and continue when setup asks you to verify Microsoft Teams setup. Greentic then polls Microsoft Graph, stores the delegated tokens as secrets, and runs post-login discovery.

  4. Select or verify the Team and channel

    Setup calls Microsoft Graph to list joined teams and channels for the signed-in user. Choose the Team and channel when prompted, or let desired_channel_name guide the create-if-missing flow.

    Setup persists both the identifiers and labels:

    • team_id and team_name
    • channel_id and channel_name

    The IDs are what runtime sends and subscription setup use. The display names are for operators and setup UIs.

  5. Check the channel in Teams

    Open Microsoft Teams and go to the selected Team and channel. If setup created desired_channel_name, confirm the channel exists and that the signed-in account has access to it.

    If the selected Team does not already have that channel, setup can create a standard channel and then stores the resulting channel_id and channel_name. The ID remains authoritative for runtime sends and subscriptions.

  6. Start or restart the runtime

    Terminal window
    gtc start ./my-bundle

    The Teams pack declares desired subscription metadata, including the Graph resource template, component config fields, notification URL template, and lifecycle notification URL template. Hosts should use this metadata instead of hard-coding Teams resource paths.

  7. Test the target channel

    Send a message in the selected Teams channel or trigger a flow that sends to Teams. If messages do not appear, re-run setup and check that the persisted team_id and channel_id still match the channel you opened in Teams.

OptionRequiredDescription
client_idYes for Graph setupPublic Microsoft application client id used for device-code OAuth
tenant_idGeneratedTenant id discovered from Microsoft Graph
team_idGenerated or selectedTeams team id used for channel sends and subscriptions
team_nameGenerated or selectedDisplay name for the selected Team
channel_idGenerated or selectedChannel id used for sends and subscriptions
channel_nameGenerated or selectedDisplay name for the selected channel
desired_channel_nameNoDefault/search hint, and channel creation name when creation is supported
chat_idNoChat id for chat subscriptions where applicable
ms_bot_app_idBot Framework modeMicrosoft Bot Framework app id
ms_bot_app_passwordBot Framework modeBot Framework app password
bot_display_nameBot Framework modeDisplay name used in Teams app manifest workflows
messaging_endpointBot Framework modePublic Bot Framework messaging endpoint

Teams Graph mode uses Microsoft Graph subscriptions for incoming channel or chat messages. Expose the Greentic runtime through HTTPS on port 443; local development can use a tunnel that forwards the public URL to the local runtime port.

DirectionProtocol and portPurpose
IncomingHTTPS 443 from Microsoft Graph to GreenticChange notifications and lifecycle notifications for Teams message subscriptions
Incoming, Bot Framework modeHTTPS 443 from Microsoft Bot Framework to GreenticBot Framework activity callbacks to the configured messaging endpoint
OutgoingHTTPS 443 from Greentic to login.microsoftonline.comDevice-code OAuth and token refresh
OutgoingHTTPS 443 from Greentic to graph.microsoft.comTeam/channel discovery, optional channel creation, message sends, and subscription reconciliation
Outgoing, Bot Framework modeHTTPS 443 from Greentic to Bot Framework service URLsReplies and proactive sends through the Bot Framework service URL from incoming activities

The Graph subscription notificationUrl and lifecycleNotificationUrl must both be publicly reachable over HTTPS. The provider pack declares the URL templates; hosts should not hard-code Teams paths.

- id: reply
type: reply
config:
message: "Hello! How can I help you today?"

Teams supports a subset of Markdown:

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

Teams has native Adaptive Card support through Bot Framework attachments. Use the version supported by your target Teams client and action model; Adaptive Cards 1.4 features such as Universal Actions are specific to supported bot scenarios.

- 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'"
to: show_help
- expression: "data.action == 'ticket'"
to: 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"

For personal 1:1 chats, no channel configuration needed. The bot responds to whoever messages it.

Send messages without user initiation:

- 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. Check endpoint configuration in Azure Bot Service
  2. Verify SSL certificate is valid
  3. Check app credentials are correct
  4. Review activity logs in Azure
  • Verify App ID and Password
  • Check tenant ID for single-tenant apps
  • Ensure bot is enabled in Teams channel
  • Validate card JSON with Adaptive Cards Designer
  • Check Teams supports the card version and action type
  • Verify all required fields are present
  • Teams can batch messages; this is normal
  • Check your server performance
  • Verify no rate limiting

Greentic automatically validates:

  • JWT signature
  • Issuer and audience claims
  • Token expiration