Connecting to Microsoft Teams

Preview

Microsoft Teams is a powerful communication and collaboration platform. It brings together chat, meetings, file sharing, and app integration in one unified workspace. By connecting your agent to Microsoft Teams, you can create a centralized hub where users can interact with your agent to streamline workflows, automate tasks, and enhance productivity.

Before you begin

You must meet the following prerequisites before you begin the integration:

To connect your agent with Microsoft Teams, you must:

  1. Register your app in Microsoft Azure

  2. Create your bot

  3. Create a Microsoft Teams app

Procedure

To connect to Microsoft Teams, perform the following steps:

  1. Go to the agent configuration page.

  2. Navigate to Channels > Teams.

  3. Select the environment (Draft or Live) and click Create New.

  4. Review the instructions on the Get started page and click Next.

  5. Review the instructions on the App registration section.

  6. Enter the Application (client) ID, tenant ID , and Client secret from the App registration page.

  7. Click Next.

  8. Review and complete the steps that are related to Create your bot on the Configure Microsoft Teams page. Refer to Create your bot for details.

  9. Copy the messaging endpoint field under Tenant ID. Go to step 7 of Create your bot and paste it .

  10. Review and complete the steps that are related to Create your Teams app on the Configure Microsoft Teams page. Refer to Creating your Teams app for details.

  11. Click Finish to complete the setup.

You can view the Microsoft Teams that are successfully connected under the respective environments. Click the overflow menu button overflow_menu to edit or delete the Microsoft Teams from that agent environment.

Register your app in Microsoft Azure

  1. Log in to the Microsoft Azure portal with your admin credentials.

  2. Go to the App registrations > New registration.

  3. On the Register an application page, enter a name, choose the appropriate tenant type, and click Register.

  4. From the Overview page of your app, copy the values of Application (client) ID and Directory (tenant) ID. Paste the value of Application (client) ID into your watsonx Orchestrate Microsoft Teams set up.

  5. Go to Manage > Certificates & secrets to create a client secret for the same app. In the Client secrets tab, click New client secret to create a new client secret. Copy and save the value.

Create your bot

Note:

IBM policy restricts access to bot services when you are using an E5 developer account. These services are only compatible with non IBM sanctioned Azure accounts. Personal accounts (Example: Gmail or Outlook) do not qualify for E5 or higher access. Only corporate accounts are eligible. Alternatively, developers can purchase a license to gain the required access.

  1. Log in to Microsoft Azure portal. Use your administrator credentials.

  2. From the list of Azure services, select Bot Services and click Create to create a new bot. Select the Azure Subscription and Plan. If not available, you must create an Azure subscription.

  3. Provide Bot handle, Subscription and Resource group. If you do not have a resource group, you must create a new resource group. To create a new resource group, click Review + create.
  4. In the Creation type, select Use existing app registration. In the App ID , paste the value of client ID saved earlier. In the App tenant ID, paste the value of tenant ID saved earlier. Click Review + create.
  5. Click Create.
  6. Go to the Settings > Configuration > Messaging endpoint and paste the copied generated endpoint from the Create your bot page of your watsonx Orchestrate Microsoft Teams set up. Click Apply .

  7. To connect the bot with Microsoft Teams, go to Channels and select Microsoft Teams . In the Messaging tab, select Microsoft Teams Commercial and click Apply.

Create a Microsoft Teams app

  1. Go to the Microsoft Teams Developer Portal, and log in with your admin credentials.

  2. Click Apps > Create a new app.

  3. Enter your app name, and click Add.

  4. Under Basic information, enter all the mandatory fields. Copy and paste your app ID from step 4 of Registering your App into Application (client) ID.

  5. Click Save.

  6. Select Configure > App features > Bot.

  7. Go to Identify your bot section. In the Enter a bot ID field, paste the value of client ID created in step 4 of Registering your App.

  8. Under Select the scope in which people can use this command, select Personal, Team, and Group Chat.

  9. Click Save, then Distribute your bot.

  10. Click Download the app package to download the ZIP file.
  11. Go to Microsoft Teams and click Apps.
  12. In the Apps page, click Upload an app and upload the ZIP file downloaded in step 10.
  13. Click on the overflow menu (...) and search for the app you added. You can interact with watsonx Orchestrate agent through Microsoft Teams now.

To refresh your session in Microsoft Teams, see Refresh your session.

Refreshing your session in Microsoft Teams

You can refresh your conversation session in Teams at any time to clear old context and start fresh. This is useful if the bot becomes confused, stuck, or you simply want to begin a new task.

How to refresh your session

When you want to reset your conversation or clear old context, you can refresh your session using one of the options below.

Option 1 : Use a chat command

In any Teams conversation with the bot, type:

/refreshSession

This instantly clears your current session and resets the conversation context.

Option 2 : Use the UI-based option

You can use the UI-based option for refreshing a session. To enable this, you must first define a compose extension in your Teams app manifest. Once enabled, this UI component provides an additional way to refresh the session. Because it relies on identifying an existing session, a message must be sent first; if no active session is found, the user will be notified.

"composeExtensions": [
  {
    "botId": "d1b6b6b7-7ae3-4c51-b05e-1316b7ff5c41",
    "commands": [
      {
        "id": "refreshSession",
        "botId": "d1b6b6b7-7ae3-4c51-b05e-1316b7ff5c41", 
        "type": "action",
        "title": "Refresh Session",
        "description": "Refresh the conversation session's context",
        "initialRun": false,
        "fetchTask": false,
        "context": [
          "commandBox",
          "compose"
        ]
      }
    ]
  }
]

For botId, use your appropriate Microsoft bot ID available in the APP manifest.

After this is configured, the Refresh Session option appears in the top bar when you type:

/YOUR_APP_NAME
Note:

Session refreshing works automatically. No setup is required. Your existing session will continue as usual until you choose to refresh it.

What to do next

To add channel‑specific context variables for Microsoft Teams follow the instructions provided in Teams context variables.