Skip to main content

Microsoft Teams Integration Guide

NeuraFlow integrates with Microsoft Teams using a multi-tenant Azure App Registration. Brain Station 23 configures the app once; customers grant access to their own tenants.


Overview

App Registration Permissions


Permissions Reference

Application Permissions (No user sign-in required)

PermissionPurposeAdmin Consent
Chat.CreateCreate chats with usersYes
User.Read.AllRead all users' full profilesYes
TeamsAppInstallation.ReadWriteForUser.AllManage Teams apps for all usersYes
AppCatalog.ReadWrite.AllRead and write to all app catalogsYes

Delegated Permissions (User sign-in required)

PermissionPurposeAdmin Consent
AppCatalog.ReadWrite.AllRead and write to all app catalogsYes
User.ReadSign in and read user profileNo
openidSign users inNo
offline_accessMaintain access (refresh tokens)No
emailView users' email addressNo
profileView users' basic profileNo

Customer Use Cases

Customers can enable three capabilities, each requiring specific permissions:


Use Case 1: Authorize Bot Capabilities

Enables NeuraFlow to send/receive messages with Teams users.

Required Permissions (Application):

  • Chat.Create - Create chat threads
  • User.Read.All - Find users by email

How it works:

  1. Admin clicks "Connect Microsoft Teams" in NeuraFlow
  2. Admin signs into Microsoft and grants consent
  3. NeuraFlow backend can now create chats and send messages

Use Case 2: Automate Catalog Push

Enables NeuraFlow to automatically publish the bot to the customer's Teams app catalog.

Required Permissions (Delegated):

  • AppCatalog.ReadWrite.All - Upload apps to catalog
  • User.Read, openid, offline_access - OAuth flow

How it works:

  1. Admin clicks "Upload to Catalog" in NeuraFlow
  2. Admin signs in via OAuth
  3. NeuraFlow uploads bot manifest on admin's behalf
  4. Bot appears in Teams app catalog

Alternative: Manual Upload

  • Download manifest.zip from NeuraFlow
  • Upload via Teams Admin Center (admin.teams.microsoft.com)

Use Case 3: Automate Bot Install for Users

Enables NeuraFlow to automatically install the bot for specific users.

Required Permissions (Application):

  • TeamsAppInstallation.ReadWriteForUser.All - Install apps for users
  • AppCatalog.ReadWrite.All - Access app catalog

How it works:

  1. Admin grants consent (one-time)
  2. NeuraFlow calls Graph API to install bot for specified users
  3. Bot appears in users' Teams automatically

Developer Setup (Brain Station 23)

Step 1: Create Azure App Registration

FieldValue
NameNeuraFlow Teams Connector
Supported account typesAccounts in any organizational directory (Multi-tenant)
Redirect URI (Web)https://neuraflow.brainstation23.com/api/v1/teams/oauth/callback

Step 2: Configure API Permissions

Navigate to API permissionsAdd a permissionMicrosoft Graph

Application Permissions:

  • Chat.Create
  • User.Read.All
  • TeamsAppInstallation.ReadWriteForUser.All
  • AppCatalog.ReadWrite.All

Delegated Permissions:

  • AppCatalog.ReadWrite.All
  • User.Read
  • openid
  • offline_access
  • email
  • profile

Step 3: Create Client Secret

Navigate to Certificates & secrets+ New client secret

FieldValue
DescriptionNeuraFlow Production
Expires24 months

Step 4: Configure Environment

AZURE_CLIENT_ID=<from-app-registration>
AZURE_CLIENT_SECRET=<generated-secret>
AZURE_TENANT_ID=<brainstation23-tenant-id>
TEAMS_BOT_APP_ID=<bot-app-id>

Customer Onboarding

Prerequisites

RequirementDetails
Microsoft 365 LicenseBusiness Basic or higher
Microsoft Entra ID RoleGlobal Administrator or Teams Administrator
NeuraFlow AccountOrganization created in NeuraFlow

Onboarding Flow

StepTypeRequired
Admin ConsentApplication permissionsYes
Catalog UploadDelegated permissionsOptional (can upload manually)

Integration Flow


Troubleshooting

"Need admin approval"

Only Global Administrators can grant admin consent for application permissions. Teams Administrators can only grant delegated permissions.

"AADSTS65001: User hasn't consented"

CauseSolution
Admin consent not grantedComplete admin consent flow
Wrong tenantSign in with correct organization account
Permissions changedRe-grant admin consent

"App not visible in Teams"

CauseSolution
Catalog upload not completedUpload bot to catalog
App pending approvalCheck Teams admin center
CachingWait up to 24 hours or clear Teams cache

Quick Reference

https://login.microsoftonline.com/{tenant}/adminconsent
?client_id={neuraflow_app_id}
&redirect_uri=https://neuraflow.brainstation23.com/api/v1/teams/oauth/callback

Required Roles

ActionRequired Ro
Admin ConsentGlobal Administrator
Catalog UploadTeams Administrator or Global Administrator

Azure Portal → Microsoft Entra ID → Enterprise applications → Search "NeuraFlow Teams Connector" → Permissions tab