Overview
CrewAI supports integration with Microsoft 365 applications including Outlook (email and calendar), OneDrive, Teams, SharePoint, Excel, and Word. This guide walks you through setting up OAuth credentials in the Azure portal to enable these integrations.Prerequisites
- Access to your organization’s Azure portal (most organizations using Microsoft 365 already have this)
- Permissions to create app registrations in your Azure tenant
- Admin consent capability for granting API permissions (may require your Microsoft 365 or Azure administrator)
Azure App Registration Setup
Step 1: Navigate to App Registrations
- Sign in to the Azure Portal
- Search for App registrations in the top search bar
- Click New registration
Step 2: Register Your Application
- Name: Enter a name for your application (e.g., “CrewAI Integration”)
- Supported account types: Select the appropriate option:
If you select single tenant, you’ll need to configure your Directory (tenant) ID in CrewAI. See Configure CrewAI Helm Values below.
-
Redirect URI:
- Select Web as the platform
-
Add the redirect URI:
Default configuration (NGINX with shared hostname):
Separate OAuth hostname (GKE/ALB with
path: "/"):
- Click Register
Step 3: Note Your Application Credentials
After registration, you’ll be taken to the app’s overview page. Note the following values:- Application (client) ID: This is your Client ID
- Directory (tenant) ID: Your organization’s tenant ID
Configure API Permissions
Step 1: Add Microsoft Graph Permissions
- In your app registration, click API permissions in the left sidebar
- Click Add a permission
- Select Microsoft Graph
- Select Delegated permissions
- Add the permissions required for your integrations (see Required Scopes below)
- Click Add permissions
Step 2: Grant Admin Consent
Some permissions require admin consent. If you have admin privileges:- Click Grant admin consent for [Your Organization]
- Click Yes to confirm
Create Client Secret
Step 1: Generate a New Secret
- In your app registration, click Certificates & secrets in the left sidebar
- Under Client secrets, click New client secret
- Enter a description (e.g., “CrewAI Production”)
-
Select an expiration period:
- 6 months - More secure, requires regular rotation
- 12 months - Balance of security and convenience
- 24 months - Less maintenance, but less secure
- Click Add
Step 2: Save the Secret Value
Store the Client ID and Client Secret securely for CrewAI configuration.Required Scopes per Integration
The following permissions should be added to your app registration. All integrations require the base permissions, plus integration-specific permissions.Base Permissions (Required for All)
Microsoft Outlook (Email)
Microsoft Outlook (Calendar)
Microsoft OneDrive
Microsoft Teams
Teams integration requires admin consent for some permissions. Ensure your organization’s Microsoft 365 or Azure administrator grants consent for the app.
Microsoft SharePoint
Microsoft Excel
Microsoft Word
Complete Permissions Summary
Here’s a consolidated view of all permissions needed for full Microsoft 365 integration:Configure CrewAI Helm Values
After obtaining your OAuth credentials, configure them in your CrewAI Helm values:Single-Tenant Configuration
If you registered your Azure app as single tenant (recommended for enterprise), you must also configure your Directory (tenant) ID:tenantId is not configured, CrewAI uses Microsoft’s multi-tenant endpoint (common), which allows users from any Microsoft 365 organization to connect their accounts.
Product-Specific Configuration
You can configure different credentials or tenant IDs for specific Microsoft services if needed:Activate the Integration
After deploying your updated Helm values, sync integrations to make them available to users — see Activate Integrations After Deployment.Troubleshooting
Common Issues
“AADSTS650052: The app needs access to a service”- Ensure all required permissions are added to the app registration
- Grant admin consent for permissions that require it
- Verify the Client ID is correct
- Ensure the app registration exists in the correct Azure tenant
- The client secret may have expired
- Create a new client secret and update your configuration
- Ensure
offline_accesspermission is granted - Check token lifetime policies in your Azure tenant
