The Microsoft Teams Bot integration allows you to trigger Torq workflows and interact with Teams users, teams, channels, and messages. You can also create a bot that posts messages, tags users with the @ command, and more.
After setup, you can either mention the bot in a chat or send a direct message. In a chat, you can describe your request in free text (e.g., "check IP address") or select a command from the command list, which you'll create in this tutorial.
Torq enables quick and easy integration with the Microsoft Teams bot, so you can automate anything and everything within moments. Torq's public Teams Bot steps include:
Ask a Question
Get Channels
Get Users
Post Adaptive Card
+7 more...
If you don't see a step you need, you can create your own in various ways, such as using the Send an HTTP Request step or Torq’s Step Builder, and share it across your organization.
Prerequisites
The following permissions are needed, with Entra ID:
Application admin
Teams admin
Windows Dev Centre admin
Developer portal admin
Azure admin
Use the old Developer Centre interface: In the top menu bar, turn the toggle off to use the old Developer Centre.
Create a Torq bot in Teams
The Torq Teams bot is a Teams app to which you assign bot capabilities. You can use the bot to send users and channels unidirectional messages or questions that expect user responses.
You can also create one or more commands that users can execute within a chat to trigger Torq workflows. For example, if you add a command called check-ip, you can define the trigger condition only to apply when that command is used in a chat.
Create a custom apps policy in Microsoft Teams
The custom apps policy allows the user creating the bot to install custom apps for their team, including the Torq Bot. If the user already has the required permissions or a custom apps policy with the necessary permissions exists, you can skip this section and proceed directly to Create a bot in Microsoft Teams dev.
Note that you must be a Teams admin to create a custom apps policy.
In Teams admin console: Log in to your Teams admin portal, navigate to Teams Apps > Setup Policies, and click Global (org-wide default).
Upload custom apps: Confirm that Upload Custom Apps is set to On.
New policy: If Upload Custom Apps is set to Off, create a new custom app policy.
Apply custom policy: Apply the custom policy to the admin-level user who will create the bot.
Create a bot in Microsoft Teams Dev
Note that you must be a Teams admin to create a bot.
Ensure you are using the old Developer Portal by turning off the New Developer Portal toggle in the menu bar.
Create a new app
Create a new app: Go to the Teams developer portal and click Apps > New app.
Name app: Give the app a relevant name, such as
Torq Bot, and click Create.Basic information: Within the app, go to Configure > Basic information
Short Name: This is pre-filled with the name you gave your app previously.
App ID: The app ID is auto-generated; copy it for later use in Torq. If you forget to copy it, you can access it again in your app Dashboard.
Short description:
Torq Security Automation BotLong description:
Torq’s no-code automation modernizes how security and operations teams work with easy workflow building, limitless integrations, and numerous prebuilt templates.Developer information, company name:
torq.ioDeveloper information, website:
https://torq.io/App URLs, privacy policy:
https://torq.io/privacyApp URLs, terms of use:
https://torq.io/terms-conditionsApplication (Client) ID: The client ID can be found in App registrations once the Teams application is published.
Click Save.
Branding: Within the app, go to Configure > Branding. Branding enables you to upload custom icons for the app/bot, which will be displayed when messages are sent to users and groups. You might want to add your company's logo/icon.
Upload an image for the Color icon. This is displayed in the store and most other places. The icon must be 192x192 pixels in total, with a 96x96-pixel symbol in the center.
Upload an image for the Outline icon. This displays on the left side of Teams when the app is in use. The icon must be 32x32 pixels and either white or transparent.
Create a new bot
Configure bot features: Go to Configure > App Features and click Bot.
Click Create new bot.
Click +New Bot, enter a name for the bot, and click Add.
Click the new bot you made and click Configure.
In the Bot endpoint address field, use the following:
If your organization is US-based (the URL for your Torq application portal is https://app.torq.io), enter:
https://teams-app.torq.io/teams/v1/interactivity-hooksIf your organization is EU-based (the URL for your Torq application portal is https://app.torq.io), enter:
https://teams-app.eu.torq.io/teams/v1/interactivity-hooks
Click Save.
Go to Client Secrets and click + New client secret. Copy the generated secret and save it in a secure location for later. Click Done
Return to Bot Card: Within the app, click Configure > App features and click the Bot card.
Define your Bot:
Under Identify your bot, select the bot you just created from the list.
Under What can your bot do?, select the desired scopes (we recommend at least Upload and download files).
Under Select the scopes where people can use your bot, select all of the scopes (Personal, Team, and Group Chat).
Finalize: Click Save, and then click Publish in the top right of the menu bar.
Publish: Select Publish to your org, and then Publish your app.
It may take some time for your bot to be published to your Teams web app.
Grant the App Permission in the Teams Admin Portal
After publishing your app, you must have an admin approve the app in the Teams Admin portal.
Navigate to Admin Portal: Go to the Teams admin portal and go to Teams apps > Manage apps.
Find app: In the search box for the table, search for the Teams app name you created earlier and click to open.
Publish app: On the application, click Publish.
Grant the App Permission in the Azure Portal
The permissions granted to the app determine which actions you can perform as steps in Torq workflows.
Navigate to Azure portal: Go to your Azure portal and navigate to App registrations.
Find your app: Click on View all applications in the directory and search for your bot by its name. Click to open.
Overview: Copy the Directory (tenant) ID and save this for later.
Allow accounts: Click on the entry for Supported account types.
Enable permissions: Go to Manage > API permissions, click +Add a permission > Microsoft Graph > Application permissions and add the following permissions.
AppCatalog.Read.All
Group.Read.All
TeamsAppInstallation.ReadWriteForTeam.All
TeamsAppInstallation.ReadWriteForUser.All
User.Read.All
The following permissions are optional but should be added if you plan to use this Microsoft Teams Bot integration with both Microsoft Teams Bot steps and Microsoft Teams steps (Microsoft Teams steps are also compatible with the Microsoft 365 integration):
Channel.ReadBasic.All
Chat.ReadWrite.All
Team.ReadBasic.All
TeamsAppInstallation.ReadForUser.All
Finalize: Click Add permissions and then Grant admin consent.
Create Bot Commands
Before you create bot commands, determine the actions you want your users to be able to perform from within a chat. In Torq, the command name will trigger a workflow.
For example, if you create a command called check-ip, each time that command is used in a chat, it will trigger a workflow that parses the IP address sent in the chat and submits it for analysis. The workflow can then return the analysis results to the same (or a different) chat.
Go to Microsoft Teams dev portal: In the Teams developer portal, go to your Apps and select the app you created. Go to App features > Bot.
Create a command: Click Add a command, and configure the command:
Optionally add more: Optionally, add more commands by clicking Add a command.
Create a Microsoft Teams Bot integration in Torq
Navigate to Integration: Go to Build > Integrations > Steps > Microsoft Teams Bot, and click Add instance.
Fill in details:
Integration name: Enter a unique and meaningful name
Microsoft Teams Bot Client ID: Navigate to your Azure portal and click App registrations. Click the app for your Torq bot, and under the Overview page, copy the value for the Application (client) ID.
Microsoft Teams Bot Client Secret: You would have copied this value to a safe location when creating the Bot in step 1f.
Microsoft Teams App ID: Navigate to your Teams developer portal. In the app you created earlier, click Basic Information. Copy the value under App ID.
Microsoft Tenant ID: Navigate to aad.portal.azure.com, and under your tenant, click App Registrations. Click the app for your Torq bot and copy the value for the Directory (tenant) ID.
Finalize: Click Add.
FAQs
How do I generate and use an authentication token for a Microsoft Teams Bot step?
Some Microsoft Teams Bot steps require an authentication token, while others require an integration instance. Make sure you add the Microsoft Teams Bot Generate Microsoft Teams Bot API Token step before other Teams Bot steps so you can pass the generated token in subsequent required steps.
Why am I not seeing my app in the Teams admin portal?
After you publish the Torq Teams App to your organization, it may take several hours to appear in the Teams admin portal because Microsoft needs time to propagate the application across your infrastructure.
Why am I receiving a 400 or Bot Framework error when creating a Teams bot?
To create a bot, the app must have the correct permissions. In the Azure portal, open the relevant app's Manage > Authentication tab and under Supported account types select Accounts in any organizational directory (Any Microsoft Entra ID tenant - Multitenant).
Templates
Now that you've added the integration check out these templates specially crafted by Torq's security experts. Visit Torq's template library for more.














