Setup
You will need:
- A published bot
- A Microsoft 365 business account
- A Microsoft Azure account that uses the same email address as your Microsoft 365 account
Step 1: Create an Azure app registration
First, create an Azure app registration:- Log in to your Azure portal.
- Using the search bar, go to the App registrations page.
- Select New registration and fill in the required fields.
In the Supported account types section, choose the account type that’s most appropriate for your use case—we support both single tenant (app available for your organization only) and multitenant (public app) accounts.
- When you’re done filling in the fields, select Register.
Step 2: Setup in Botpress
Next, setup the integration in Botpress:1
Install the integration in Botpress
- In Botpress Studio, select Explore Hub in the upper-right corner.
- Search for the Microsoft Teams integration, then select Install Integration.
2
Configure the integration in Botpress
To configure the integration, you need to create a webhook endpoint for the Teams integration. To do this, fill in the integration’s Configuration fields using information from your Azure app:
When you’ve filled in all the fields, select Save Configuration. This will automatically enable your integration.
App ID
App ID
In the Overview section of your Azure app, copy the Application (client) ID. Then, paste it in the App ID field in Botpress.
App Password
App Password
- In your Azure app’s left sidebar, go to Manage > Certificates & secrets.
- Select New client secret.
- Set a description and expiry date for your secret.
- Copy the Value of the generated secret.
- Paste it in the App Password field in Botpress.
Tenant ID
Tenant ID
In the Overview section of your Azure app, copy the Directory (tenant) ID. Then, paste it in the Tenant ID field in Botpress.
Step 3: Create a Microsoft bot
1
Create a Microsoft bot
Now, you need to create a Microsoft bot. This bot communicates with your Botpress webhook URL to chat with members of your Teams workspace.
- In your Azure portal homepage, select Create a resource.
- Search for Azure Bot, then select Create.
- Scroll to the Creation type section, then select Use existing app registration.
- Fill in the App ID and App tenant ID fields with the same app ID and tenant ID you used to configure the integration in Botpress.
- Fill in the other required fields as necessary.
- Select Review + Create, then Create.
2
Connect your Botpress webhook
Now that you’ve created a Microsoft bot, you can use the integration’s webhook to connect it to your Botpress bot:
- Wait for the bot’s deployment to complete, then select Go to resource.
- In the left sidebar, go to Settings > Configuration.
- Paste the Botpress webhook URL (starting with
https://webhook.botpress.cloud/
) into the Messaging endpoint field. You can find the webhook URL in the integration’s configuration menu. - Select Apply.
- In the left sidebar, go to Settings > Channels.
- Scroll down and select Microsoft Teams.
Make sure you actually select the Microsoft Teams text, or the channel configuration menu won’t open.
- Agree to the terms of service, then select Apply.
3
Copy your Microsoft app ID
While you’re still in the Settings > Configuration menu, copy your Microsoft App ID—you’ll need it for the next steps.
Step 4: Create a Teams app
Finally, create an app in your Teams developer portal:1
Setup in Teams developer portal
First, create a new app:
- Log in to the Teams developer portal
- Select Create a new app and enter a name for the app.
- In the left sidebar, go to the Basic information section.
-
Fill in the required fields:
- Short name
- Long name
- Short description
- Long description
- Developer or company name
- Website
- Privacy policy
This information will be shown to members of your Teams workspace that chat with your bot.
- In the Application (client ID) field, paste the Microsoft App ID you copied earlier.
- At the bottom of the screen, select Save.
2
Add Azure bot to Teams app
Next, add your Azure bot to the app:
- In the left sidebar, go to App features and select Bot.
- Select Enter a bot ID, then paste the Microsoft App ID again.
- Select the Personal, Team and Group chat scopes.
- Select Save.
3
Configure app permissions
In the left sidebar, go to Permissions. Select the following permissions for your app:
When you’re done, select Save.
Team permissions
Team permissions
Under Application:
ChannelMessage.Read.Group
ChannelMessage.Send.Group
TeamsActivity.Send.Group
Chat/meeting permissions
Chat/meeting permissions
Under Application:
ChatMessage.Read.Chat
ChatMessage.Send.Chat
ChatMessageReadReceipt.Read.Chat
TeamsActivity.Send.Chat
TeamsTab.ReadWrite.Chat
TeamsTab.Read.Chat
LiveShareSession.ReadWrite.Chat
4
Preview in Teams
Now, the bot should be fully configured. To test it:
- In the upper-right corner, select Preview in Teams.
- Once the bot has opened in Teams, select Add.
- After the bot is added, select Open to start chatting with it (or a channel to use it in).
If you get a Manifest parsing failed error message, make sure you filled out all the required fields in your app’s Basic Information section. The Short description and Long description fields are required, even though they’re not marked as such.
At this point, the bot is only available for you to test. To make it available for anyone in your organization, follow the steps below.
Step 5: Publish the bot to your organization
Finally, you can publish your bot to make it available for anyone in your organization:- Go back to your app’s menu in the Teams developer portal.
- In the app’s left sidebar, go to Publish > Publish to org.
- Select Get started.
Your Teams integration is ready. Once the app has been approved, anyone in your Teams organization can add it and chat with your bot.
Troubleshooting
Manifest parsing failed
Manifest parsing failed
If you get a Manifest parsing failed error message when trying to preview your bot in Teams, make sure you filled all the required fields in your app’s Basic Information section.
The Short description and Long description fields are required, even though they’re not marked as such.
Can't preview app in Teams
Can't preview app in Teams
If you’re unable to preview your bot in Teams, make sure you’ve enabled the policy to allow uploading custom apps:
- Log in to the Teams admin center.
- In the left sidebar, go to Teams apps > Setup policies.
- Select Global (Org-wide default)
- Make sure Upload custom apps is turned on.
- Select Save.
Changes to this policy might not take effect immediately. If you still can’t access the preview in Teams even after updating, wait a while and try again.