Microsoft Teams Configuration

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.

Go to Azure Portal

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

  1. In the left pane, under Manage, select Certificates & secrets.

  2. Under Client secrets, select + New client secret.

  3. 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

  1. In the left pane, select API permissions.

  2. Select ”+ Add a permission”, then select Microsoft Graph.

  3. Under “What type of permissions does your application need?”, select Application permissions.

  4. Under “Select permissions”, expand User and select User.Read.All.

  5. Click “Add permissions” to save the changes.

9. Add Application ID URI

  1. In the left pane, under Manage, select Expose an API.

  2. Update the Application ID URI to api://api.stack-ai.com/<APP_ID> and select Save.

10. Add a scope

  1. In the left pane, under Manage, select Expose an API.

  2. Select + Add a scope.

  3. Enter access_as_user as the Scope name.

  4. 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

  1. In the left pane, under Manage, select Expose an API.

  2. Under Authorized client applications, select + Add a client application.

  3. 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

  4. Select the Authorized scopes checkbox.

  5. Select Add application.

12. Create Azure Bot Resource

  1. Go to Home and select + Create a resource

  2. In the search box, enter “Azure Bot” and select Enter

  3. 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

  1. In the left pane, select Channels.

  2. Under Available Channels, select Microsoft Teams.

  1. Select the checkbox to accept the Terms of Service and Apply.

14. Add Messaging Endpoint

  1. In the left pane, under Settings, select Configuration.

  2. Update the Messaging endpoint with the following URL:

Select Apply to save the configuration.