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:
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
- In the left navigation menu, click Connectors.
- On the Available tab, locate Teams and click Add.
- Enter a descriptive connector name.
- Click Confirm. The Microsoft authorization flow opens in a dialog.
- Select the Microsoft account to connect, or select Use another account.
- Wait for the authorization dialog to close and return to EMQX Agents.
- On the Added tab, verify that the connector status is Authorized.
Supported Tools
Chats
| Tool | Access | Description |
|---|---|---|
MICROSOFT_TEAMS_CHATS_GET_ALL_CHATS | Read | Lists chats associated with a user. |
MICROSOFT_TEAMS_GET_CHAT | Read | Gets chat details. |
MICROSOFT_TEAMS_GET_USER_CHAT | Read | Gets a chat for a selected user. |
Online Meetings
| Tool | Access | Description |
|---|---|---|
MICROSOFT_TEAMS_CREATE_MEETING | Write | Creates a standalone online meeting. |
MICROSOFT_TEAMS_CREATE_USER_ONLINE_MEETING | Write | Creates an online meeting for a selected user. |
MICROSOFT_TEAMS_GET_ONLINE_MEETING | Read | Gets online meeting details. |
Teams and Channels
| Tool | Access | Description |
|---|---|---|
MICROSOFT_TEAMS_GET_CHANNEL | Read | Gets channel details. |
MICROSOFT_TEAMS_GET_PRIMARY_CHANNEL | Read | Gets the primary channel of a team. |
MICROSOFT_TEAMS_GET_TEAM_FROM_GROUP | Read | Gets a team from a group ID. |
MICROSOFT_TEAMS_LIST_ASSOCIATED_TEAMS | Read | Lists teams associated with a user. |
MICROSOFT_TEAMS_LIST_USER_JOINED_TEAMS | Read | Lists teams joined by a user. |
MICROSOFT_TEAMS_TEAMS_LIST | Read | Lists teams available to the authorized user. |
MICROSOFT_TEAMS_TEAMS_LIST_CHANNELS | Read | Lists channels in a team. |
MICROSOFT_TEAMS_CREATE_CHANNEL | Write | Creates a channel in a team. |
User and Shifts
| Tool | Access | Description |
|---|---|---|
MICROSOFT_TEAMS_GET_MY_PROFILE | Read | Gets the current Teams user profile. |
MICROSOFT_TEAMS_LIST_SHIFTS | Read | Lists shift records in Microsoft Teams Shifts. |
Messages
| Tool | Access | Description |
|---|---|---|
MICROSOFT_TEAMS_GET_CHANNEL_MESSAGE | Read | Gets a channel message. |
MICROSOFT_TEAMS_GET_CHAT_MESSAGE | Read | Gets a chat message. |
MICROSOFT_TEAMS_LIST_MESSAGE_REPLIES | Read | Lists replies to a channel message. |
MICROSOFT_TEAMS_LIST_USER_CHAT_MESSAGES | Read | Lists messages in a user's chat. |
MICROSOFT_TEAMS_SEARCH_MESSAGES | Read | Searches chat and channel messages by using KQL. |
MICROSOFT_TEAMS_TEAMS_LIST_CHANNEL_MESSAGES | Read | Lists messages in a channel. |
MICROSOFT_TEAMS_POST_MESSAGE_REPLY | Write | Replies to a channel message. |
MICROSOFT_TEAMS_TEAMS_POST_CHANNEL_MESSAGE | Write | Posts a top-level message to a channel. |
MICROSOFT_TEAMS_TEAMS_POST_CHAT_MESSAGE | Write | Posts 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
- In the chat input area, click the connector icon.
- Select the authorized Teams connector.
- In the prompt, identify the external resource and operation that the agent should use.
- 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
| Symptom | Resolution |
|---|---|
| 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. |