Microsoft Teams
Configure your Microsoft Teams application to use your workflow within your workspace.
1. Navigate to Azure Portal
Navigate to Azure Portal to create your application.
2. New Registration
Select App registrations and Click on "New Registration" to create a new app.
3. Register Application
Enter the name of your app and select "Accounts in any organizational directory" and click on "Register".
4. Application ID
Your app is registered in Microsoft Entra ID. The app overview page appears.
Copy the Application (client) ID from Microsoft Entra ID, and paste it in your configuration.
5. Add Web Authentication
In the left pane, under Manage, select Authentication. Under Web, select Add URI.
Enter https://token.botframework.com/.auth/web/redirect and Select Save.
6. Configure Redirect URI
Enter the redirect URI and enable Access tokens and ID tokens.
The redirect URI should be: {BASE_INFERENCE_URL}/auth-end
7. Create a client secret
In the left pane, under Manage, select Certificates & secrets.
Under Client secrets, select + New client secret.
The Add a client secret window appears, enter the description and select Add.
Select Copy to clipboard to save the client secret value for further use.
8. Add API permissions
In the left pane, select API permissions.
Select "+ Add a permission", then select Microsoft Graph.
Under "What type of permissions does your application need?", select Application permissions.
Under "Select permissions", expand User and select User.Read.All.
Click "Add permissions" to save the changes.
9. Add Application ID URI
In the left pane, under Manage, select Expose an API.
Update the Application ID URI to
api://api.stack-ai.com/<APP_ID>
and select Save.
10. Add a scope
In the left pane, under Manage, select Expose an API.
Select + Add a scope.
Enter access_as_user as the Scope name.
Under Who can consent?, select Admins and users.
Update the values for the rest of the fields as follows:
Enter "Teams can access the user's profile" as Admin consent display name.
Enter "Allows Teams to call the app's web APIs as the current user" as Admin consent description.
Enter "Teams can access the user profile and make requests on the user's behalf" as User consent display name.
Enter "Enable Teams to call this app's APIs with the same rights as the user" as User consent description.
Ensure that State is set to Enabled.
Select Add scope.
11. Add client application
In the left pane, under Manage, select Expose an API.
Under Authorized client applications, select + Add a client application.
Add Teams mobile or desktop and Teams web application:
For Teams mobile or desktop: Enter Client ID as
1fec8e78-bce4-4aaf-ab1b-5451cc387264
For Teams web: Enter Client ID as
5e3ce6c0-2b1f-4285-8d4b-75ee78787346
Select the Authorized scopes checkbox.
Select Add application.
12. Create Azure Bot Resource
Go to Home and select + Create a resource
In the search box, enter "Azure Bot" and select Enter
Select Azure Bot, then select Create
For the bot configuration:
Enter a name for your bot in Bot handle
Select your Subscription from the dropdown
Select or create a Resource group
Under Pricing, select "FO Free" plan
For Microsoft App ID, select Type of App as "Multi Tenant"
In Creation type, select "Use existing app registration"
Enter the App ID from your previous registration
13. Add a Teams channel
In the left pane, select Channels.
Under Available Channels, select Microsoft Teams.
Select the checkbox to accept the Terms of Service and Apply.
14. Add Messaging Endpoint
In the left pane, under Settings, select Configuration.
Update the Messaging endpoint with the following URL: https://api.stack-ai.com/msft-teams/<YOUR_PROJECT_ID>/messages?api_key=dcb61e4b-0ebf-4359-b771-9a7d7eaefaf1
Replace
<YOUR_PROJECT_ID>
with the workflow id in your URL.
Click Apply to save the configuration.
15. Save StackAI Interface
Go back to StackAI's website and save the StackAI interface in the top right corner.

16. Upload App to Teams
Now, go to Microsoft Teams. On the left sidebar, click Apps.

Now, go to 'Manage Your Apps'.

Click, 'Upload an App.' Then, choose an option.
Here, you will be prompted to upload your app's manifest. The manifest file should contain a JSON file, and two .PNG files, named color.png and outline.png. These two images will serve as the icons of your app. The JSON file must be named manifest.json. Feel free to use the following template, replace "botId"
with the Microsoft App ID from step 4. "id"
can be a randomly generated UUID, but must be unique to each bot you upload to Microsoft Teams.
{
"$schema": "https://developer.microsoft.com/json-schemas/teams/v1.19/MicrosoftTeams.schema.json",
"manifestVersion": "1.19",
"version": "1.0.0",
"id": "25790e2c-b357-4a78-85ab-e6dfd826341b",
"developer": {
"name": "Stack AI",
"websiteUrl": "https://www.stack-ai.com",
"privacyUrl": "https://www.stack-ai.com/privacy",
"termsOfUseUrl": "https://www.stack-ai.com/terms"
},
"name": {
"short": "Bot Name",
"full": "Bot Name"
},
"description": {
"short": "Chatbot",
"full": "Chatbot for Microsoft Teams"
},
"icons": {
"outline": "outline.png",
"color": "color.png"
},
"accentColor": "#ffffff",
"bots": [
{
"botId": "25790e2c-b357-4a78-85ab-e6dfd826341b",
"needsChannelSelector": false,
"isNotificationOnly": false,
"scopes": [
"team"
]
}
],
"permissions": [],
"validDomains": [
"api.stack-ai.com"
]
}
17. Add App to a Channel
Open a channel where you'd like to use your chatbot. Click on apps.

Select your app and add it to the channel. Now you can reference your bot as if it's a member of your channel by typing @ and the name of your bot.
Don't forget the publish if you make changes to your agent's workflow so that your bot is updated!
Last updated
Was this helpful?