Skip to content

Connect EMQX Agents to Microsoft Teams

The Microsoft Teams connector lets EMQX Agents work with chats, teams, channels, messages, online meetings, user profiles, and shifts. Use it for collaboration, incident communication, meeting creation, and operational follow-up.

Common Use Cases

  • Send an alert to a Teams channel after an agent detects an incident.
  • Search chats and channels for related operational context.
  • Create an online meeting for incident responders.
  • Summarize recent channel messages or shift records.

Example chat prompt:

text
Use the operations-teams connector to post a message in the Device Operations channel when the agent confirms a critical alert. Include the device ID and incident summary.

Prerequisites

Before adding the connector, prepare:

  • A Microsoft account with access to Microsoft Teams.
  • Permission to authorize the required chat, team, channel, message, meeting, profile, and shift operations.
  • Membership in the teams, channels, and chats required by the workflow.

Add a Microsoft Teams Connector

  1. In the left navigation menu, click Connectors.
  2. On the Available tab, locate Teams and click Add.
  3. Enter a descriptive connector name.
  4. Click Confirm. The Microsoft authorization flow opens in a dialog.
  5. Select the Microsoft account to connect, or select Use another account.
  6. Wait for the authorization dialog to close and return to EMQX Agents.
  7. On the Added tab, verify that the connector status is Authorized.

Supported Tools

Chats

ToolAccessDescription
MICROSOFT_TEAMS_CHATS_GET_ALL_CHATSReadLists chats associated with a user.
MICROSOFT_TEAMS_GET_CHATReadGets chat details.
MICROSOFT_TEAMS_GET_USER_CHATReadGets a chat for a selected user.

Online Meetings

ToolAccessDescription
MICROSOFT_TEAMS_CREATE_MEETINGWriteCreates a standalone online meeting.
MICROSOFT_TEAMS_CREATE_USER_ONLINE_MEETINGWriteCreates an online meeting for a selected user.
MICROSOFT_TEAMS_GET_ONLINE_MEETINGReadGets online meeting details.

Teams and Channels

ToolAccessDescription
MICROSOFT_TEAMS_GET_CHANNELReadGets channel details.
MICROSOFT_TEAMS_GET_PRIMARY_CHANNELReadGets the primary channel of a team.
MICROSOFT_TEAMS_GET_TEAM_FROM_GROUPReadGets a team from a group ID.
MICROSOFT_TEAMS_LIST_ASSOCIATED_TEAMSReadLists teams associated with a user.
MICROSOFT_TEAMS_LIST_USER_JOINED_TEAMSReadLists teams joined by a user.
MICROSOFT_TEAMS_TEAMS_LISTReadLists teams available to the authorized user.
MICROSOFT_TEAMS_TEAMS_LIST_CHANNELSReadLists channels in a team.
MICROSOFT_TEAMS_CREATE_CHANNELWriteCreates a channel in a team.

User and Shifts

ToolAccessDescription
MICROSOFT_TEAMS_GET_MY_PROFILEReadGets the current Teams user profile.
MICROSOFT_TEAMS_LIST_SHIFTSReadLists shift records in Microsoft Teams Shifts.

Messages

ToolAccessDescription
MICROSOFT_TEAMS_GET_CHANNEL_MESSAGEReadGets a channel message.
MICROSOFT_TEAMS_GET_CHAT_MESSAGEReadGets a chat message.
MICROSOFT_TEAMS_LIST_MESSAGE_REPLIESReadLists replies to a channel message.
MICROSOFT_TEAMS_LIST_USER_CHAT_MESSAGESReadLists messages in a user's chat.
MICROSOFT_TEAMS_SEARCH_MESSAGESReadSearches chat and channel messages by using KQL.
MICROSOFT_TEAMS_TEAMS_LIST_CHANNEL_MESSAGESReadLists messages in a channel.
MICROSOFT_TEAMS_POST_MESSAGE_REPLYWriteReplies to a channel message.
MICROSOFT_TEAMS_TEAMS_POST_CHANNEL_MESSAGEWritePosts a top-level message to a channel.
MICROSOFT_TEAMS_TEAMS_POST_CHAT_MESSAGEWritePosts a message to a chat.

Important Notice

Message send, reply, channel creation, and meeting creation tools communicate with users or change Teams resources. Confirm the target team, channel, chat, or attendees before write operations.

Use the Connector in a Chat

  1. In the chat input area, click the connector icon.
  2. Select the authorized Teams connector.
  3. In the prompt, identify the external resource and operation that the agent should use.
  4. Review the generated agent definition and confirm that it contains only the required tools.

Permissions and Data Access

The connector uses the authorized Microsoft account. Microsoft 365 tenant policies, team and channel membership, chat access, and administrator consent determine available resources and operations.

Do not include external service credentials or access tokens in the chat prompt or agent instructions.

Limitations

  • Microsoft Graph API quotas and tenant policies apply.
  • Private or shared channel access depends on membership and tenant configuration.
  • Meeting, shift, and message capabilities can require additional Microsoft 365 permissions.

Troubleshooting

SymptomResolution
The connector remains Unauthorized.Retry authorization and select the intended Microsoft account.
A tool returns a permission error.Verify the authorized account's access to the target team, channel, chat, or meeting. Check Microsoft 365 tenant policies and administrator consent if necessary.
A required tool is unavailable.Verify that the tool is supported and approved for this connector, then select the connector again in the chat.
Requests are rejected intermittently.Check the external service status, API quota, rate limits, and account plan.