An API that connects multiple Microsoft services, enabling data access and automation across platforms
A resilient design should not rely only on lifecycle notifications.
Supported facts from Microsoft Graph documentation:
-
reauthorizationRequiredis sent when the access token is about to expire, when the subscription is about to expire, or when an administrator revoked the app’s permissions to read a resource. - Microsoft Graph sends that authorization challenge to the
lifecycleNotificationUrl. - Change notifications can continue for a while after the challenge is sent, but eventually delivery pauses until the subscription is reauthorized or recreated.
- Any resource changes that occur while delivery is paused and before the app successfully creates the subscription again are lost from webhook delivery and must be recovered separately, for example by using delta query.
-
reauthorizationRequiredis supported for all resources. -
missedmeans some change notifications were not delivered, for example because of throttling. The documented response is to acknowledge the event, validate it, and perform a full data resync of the resource, for example with delta query. -
subscriptionRemovedmeans the subscription was removed and must be recreated.
For the design goals listed:
- Renew subscriptions before expiration
Use a scheduled renewal process based on the storedexpirationDateTime, instead of waiting only forreauthorizationRequired. The documentation explicitly says to extend a subscription before it expires. - Prevent permanent sync loss when a lifecycle event is lost
Treat lifecycle notifications as recovery signals, not the only control plane. If notifications stop or a subscription expires or is removed, recreate or renew the subscription and resync the resource state with delta query to recover missed changes. - Detect authentication failures promptly
reauthorizationRequiredis the documented signal for token-expiry, subscription-expiry, and permission-revocation conditions.subscriptionRemovedcan also occur when access conditions change and the app may need a new access token before it can create a new subscription.
Answers to the specific questions:
- The provided documentation does not state whether webhook throttling applies to
reauthorizationRequiredlifecycle notifications specifically, or only to resource change notifications. - The provided documentation does not state how long Microsoft Graph retries delivery of a failed
reauthorizationRequiredlifecycle notification. - A
missedlifecycle event means some change notifications were not delivered. The documentation does not state that a latermissedevent specifically indicates an earlierreauthorizationRequirednotification was not delivered. - The documented resilient pattern is to renew subscriptions proactively before expiration and also handle lifecycle notifications. For
missed, the documented action is full resync, not subscription renewal by itself. ForreauthorizationRequired, acknowledge, validate, ensure a valid access token, and then either callPOST /subscriptions/{id}/reauthorizeorPATCH /subscriptions/{id}. If reauthorizing and renewing together, use a singlePATCH /subscriptions/{id}with an updatedexpirationDateTime. Do not sendPOST /subscriptions/{id}/reauthorizeandPATCH /subscriptions/{id}for the same subscription within a 10-minute window.
A practical pattern for this scenario is:
- Keep the stored subscription ID and
expirationDateTime. - Run scheduled renewal before expiration.
- Handle
reauthorizationRequiredimmediately and resume the flow by reauthorizing or patching the subscription. - Handle
subscriptionRemovedby creating a new subscription. - Handle
missedby running a full resync or delta-based catch-up. - If notification delivery pauses or the subscription lapses, assume webhook gaps occurred and recover state from the resource directly.
References: