It seems like you’re trying to accomplish several tasks: inviting individual users to share their calendars, setting up a timer-triggered function app to check for changes in these calendars, and dealing with some errors related to user consent and mailbox status. Let’s address these one by one:
- Inviting Individual Users to Share Their Calendars: Microsoft Graph API provides the ability to create an invitation for external users. However, sharing calendars is a bit more complex. The user who owns the calendar needs to share it. You might need to guide your clients to share their calendars with the service principal of your application.
- Setting Up a Timer-Triggered Function App: Azure Functions support timer triggers, which let you run a function on a schedule. You can use this feature to periodically check for changes in your clients’ calendars.
- Error - “The mailbox is either inactive, soft-deleted, or is hosted on-premise”: This error typically occurs when the user doesn’t have a valid Microsoft 365 license. An Exchange Online mailbox and Outlook calendars are only available/created for users with a valid Microsoft 365 license.
- Creating a Consent URL for Individuals: The error message “App needs permission to access resources in your organization that only an admin can grant” suggests that the permissions your app is requesting require admin consent. Even if your app doesn’t request any admin-required permissions, certain permissions in Microsoft Graph require admin consent regardless of their ‘admin consent required’ property. You might need to review the permissions your app is requesting.
- Inviting Individuals, Not Entire Tenants: As you noted, much of the content around this topic is oriented towards B2B scenarios where an entire tenant is invited. However, the invitation feature of Microsoft Graph API allows you to invite individual users.
Remember, this is a complex scenario involving multiple components (Azure Functions, Microsoft Graph API, user consent, etc.), and each component has its own requirements and constraints. It’s important to understand each part thoroughly.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".