Skip to main content

Microsoft 365 Apps Integration

Connect Chatty AI with Microsoft 365 services including Outlook, OneDrive, Teams, SharePoint, and more.

Overview

Microsoft 365 integration allows Chatty AI to access and interact with your Microsoft 365 data and services.

Supported Services:

  • 📧 Outlook - Email management
  • 📁 OneDrive - File storage and sharing
  • 👥 Teams - Team collaboration
  • 📊 SharePoint - Document management
  • 📅 Calendar - Schedule management
  • To Do - Task management
  • 📋 Planner - Project planning
  • 📝 OneNote - Note taking
  • 📈 Excel - Spreadsheet access

Configuration

For all deployments using Chatty AI MCP servers:

Chatty AI provides a pre-configured multitenant Azure App Registration:

  • No Azure setup required - Use Chatty AI's multitenant app
  • Pre-configured permissions - All MS365 services enabled
  • Vendor-managed - Credentials handled securely
  • Works with Chatty AI MCP servers - Seamless integration

Requirements:

  • Must use Chatty AI MCP servers for MS365 integration
  • MCP server URLs provided by vendor

MCP Server URLs:

# MS365 MCP Server (Chatty AI Hosted)
MS365_MCP_SERVER_URL=https://mcp-ms365.chattyai.io

# Or internal deployment
MS365_MCP_SERVER_URL=http://mcp-ms365:3100

Configuration:

# In .env file
CHATTY_APP_SHOW_APPS=true
CHATTY_APP_AUTO_CONNECT_ON_STARTUP=false

# MCP Server for MS365
MS365_MCP_SERVER_URL=https://mcp-ms365.chattyai.io

For Portainer Deployments:

  • Credentials are pre-configured by vendor
  • MCP server URL is pre-configured
  • No customer action required

For Docker Compose Deployments:

  • Contact vendor for MCP server URL
  • Add MCP server URL to .env
  • Restart services

Option 2: Custom Azure App Registration

Only required if NOT using Chatty AI MCP servers:

If you want to use your own infrastructure without Chatty AI MCP servers, you must create your own Azure App Registration:

Step 1: Create Azure App Registration

  1. Go to Azure Portal
  2. Navigate to Azure Active DirectoryApp registrations
  3. Click New registration
  4. Configure:
    • Name: Chatty AI MS365 Integration
    • Supported account types: Multitenant
    • Redirect URI: https://YOUR_CHATTYAI_DOMAIN/oauth/microsoft/callback
  5. Click Register

Step 2: Configure API Permissions

  1. Go to API permissions
  2. Click Add a permissionMicrosoft Graph
  3. Select Delegated permissions
  4. Add these required permissions:

User & Profile (Required):

  • User.Read - Read signed-in user's profile
  • User.ReadBasic.All - Read basic profiles of all users

Email (Outlook):

  • Mail.Read - Read user's email
  • Mail.ReadWrite - Read and write user's email
  • Mail.Send - Send email as user
  • MailboxSettings.Read - Read user's mailbox settings

Files (OneDrive):

  • Files.Read - Read user's files
  • Files.Read.All - Read all files user can access
  • Files.ReadWrite - Read and write user's files
  • Files.ReadWrite.All - Read and write all files user can access

Calendar:

  • Calendars.Read - Read user's calendars
  • Calendars.ReadWrite - Read and write user's calendars

Tasks (To Do):

  • Tasks.Read - Read user's tasks
  • Tasks.ReadWrite - Create, read, update and delete user's tasks

Notes (OneNote):

  • Notes.Read - Read user's notebooks
  • Notes.Read.All - Read all notebooks user can access
  • Notes.ReadWrite - Read and write user's notebooks

SharePoint & Teams:

  • Sites.Read.All - Read items in all site collections
  • Sites.ReadWrite.All - Read and write items in all site collections
  • Team.ReadBasic.All - Read names and descriptions of teams
  • Channel.ReadBasic.All - Read channel names and descriptions

Excel:

  • Files.Read - Read Excel files (covered above)
  • Files.ReadWrite - Read and write Excel files (covered above)

Planner:

  • Tasks.Read - Read user's planner tasks
  • Tasks.ReadWrite - Create, read, update and delete user's planner tasks
  • Group.Read.All - Read all groups (for planner)
  1. Click Grant admin consent for [Your Organization]
  2. Confirm admin consent

Permission Scope Summary

ServiceMinimum PermissionsRecommended Permissions
OutlookMail.Read, Mail.SendMail.ReadWrite, MailboxSettings.Read
OneDriveFiles.ReadFiles.ReadWrite.All
CalendarCalendars.ReadCalendars.ReadWrite
To DoTasks.ReadTasks.ReadWrite
OneNoteNotes.ReadNotes.ReadWrite
SharePointSites.Read.AllSites.ReadWrite.All
TeamsTeam.ReadBasic.AllChannel.ReadBasic.All
PlannerTasks.Read, Group.Read.AllTasks.ReadWrite

Step 3: Create Client Secret

  1. Go to Certificates & secrets
  2. Click New client secret
  3. Set expiration (24 months recommended)
  4. Click Add
  5. Copy the secret value immediately

Step 4: Configure Environment Variables

Add to .env:

# Microsoft 365 OAuth Configuration
CHATTY_APP_MS365_OAUTH_CLIENT_ID=your-client-id-here
CHATTY_APP_MS365_OAUTH_CLIENT_SECRET=your-secret-here
CHATTY_APP_MS365_OAUTH_TENANT_ID=common

# Enable MS365 apps
CHATTY_APP_SHOW_APPS=true
CHATTY_APP_AUTO_CONNECT_ON_STARTUP=false

Step 5: Restart Services

docker compose restart chattyai

Using MS365 Apps

Connecting Your Account

  1. Login to Chatty AI
  2. Go to SettingsApps
  3. Find Microsoft 365 app
  4. Click "Connect"
  5. Authorize with your Microsoft account
  6. Grant permissions when prompted

Example Interactions

Outlook

User: Show me my unread emails from today

Chatty AI: [Accesses Outlook]
You have 5 unread emails:
1. Meeting reminder from John
2. Project update from Sarah
...
User: Send an email to john@company.com about the meeting

Chatty AI: [Composes and sends email via Outlook]
Email sent to john@company.com

OneDrive

User: Find the Q4 report in my OneDrive

Chatty AI: [Searches OneDrive]
Found: Q4_Financial_Report.xlsx
Location: /Documents/Reports/
Modified: 2 days ago
User: Share the Q4 report with sarah@company.com

Chatty AI: [Shares file via OneDrive]
File shared with sarah@company.com

Calendar

User: What meetings do I have tomorrow?

Chatty AI: [Checks Calendar]
Tomorrow's meetings:
- 9:00 AM: Team standup
- 2:00 PM: Client call
- 4:00 PM: Project review
User: Schedule a meeting with John for next Monday at 10 AM

Chatty AI: [Creates calendar event]
Meeting scheduled for Monday, April 15 at 10:00 AM

Security & Privacy

Data Access

  • User-specific: Each user authorizes their own account
  • Scoped permissions: Only requested permissions granted
  • Revocable: Users can revoke access anytime

Revoking Access

In Chatty AI:

  1. Settings → Apps
  2. Find Microsoft 365
  3. Click "Disconnect"

In Microsoft Account:

  1. Go to Microsoft Account
  2. Security → App permissions
  3. Find "Chatty AI"
  4. Click "Remove"

Token Storage

  • OAuth tokens stored encrypted
  • Tokens refreshed automatically
  • Tokens expire after inactivity

Troubleshooting

Cannot Connect MS365 Account

# Check environment variables
docker compose exec chattyai env | grep CHATTY_APP_MS365

# Verify redirect URI matches Azure
grep CHATTYAI_URL .env

# Check logs
docker compose logs chattyai | grep -i oauth

Permission Denied Errors

# Verify permissions granted in Azure
# Azure Portal → App Registration → API permissions

# Check admin consent granted
# May require tenant admin approval

# Reconnect account
# Settings → Apps → Disconnect → Connect again

Token Expired

# Tokens refresh automatically
# If issues persist, reconnect account

# Settings → Apps → Microsoft 365 → Disconnect → Connect

Environment Variables Reference

See Core Application Variables for complete details:

  • CHATTY_APP_SHOW_APPS - Show/hide MS365 apps
  • CHATTY_APP_AUTO_CONNECT_ON_STARTUP - Auto-connect on startup
  • CHATTY_APP_MS365_OAUTH_CLIENT_ID - Azure client ID
  • CHATTY_APP_MS365_OAUTH_CLIENT_SECRET - Azure client secret
  • CHATTY_APP_MS365_OAUTH_TENANT_ID - Azure tenant ID