An API that connects multiple Microsoft services, enabling data access and automation across platforms
Microsoft Graph does not support creating a single subscription at the tenant level to receive notifications for all users' mailboxes. Instead, you need to create individual subscriptions for each user mailbox. This means that for your scenario with approximately 5,000 users, you will need to set up 5,000 separate subscriptions, each targeting the respective user's inbox messages.
Scalability Limits
The maximum limit for active subscriptions per mailbox is 1,000 for all applications combined. Therefore, if you are managing subscriptions for 5,000 users, you will need to ensure that you stay within this limit by possibly managing subscriptions efficiently or rotating them as needed.
Recommended Design Patterns
To handle thousands of users efficiently, consider the following design patterns:
- Batch Processing: Group user subscriptions and manage them in batches, possibly refreshing them periodically.
- Event-Driven Architecture: Use an event-driven approach to process notifications as they come in, which can help in scaling your application.
- Caching: Implement caching strategies to minimize repeated API calls for the same data.
Permissions
Using application permissions is indeed sufficient for this scenario as it allows your application to access all users' mailboxes without needing individual user consent. This is crucial for managing a large number of subscriptions effectively.
For further details on managing subscriptions and permissions, you can refer to the Microsoft Graph documentation.