Microsoft Graph partner events lifecycle notifications stopped and subscription expired
I have a function app running on consumption plan, subscribed to an Event Grid partner topic. It works mostly, receiving lifecycle notifications and auto-renewing the subscription. Every few days though, in the middle of the night, between 1-3am, it just stops. There are no log entries for any lifecycle event and application insights shows no failures in the period. The subscription just disappears. Either it just disappeared, or Azure didn't send the
reauthorizationRequired
message or the consumption plan failed and the function wasn't running when the lifecycle notification was sent. Given there are no errors anywhere in application insights for the function app, is this a limitation of the consumption plan, that it may just stop in the middle of the night? The subscription is for user events in Entra so there will likely not be any in the middle of the night and the plan shuts down.
It seems to be related to this consumption plan behaviour where the plan just goes to sleep and needs to be manually awakened. That would explain the missed lifecycle notifications.
Is it necessary to run a TimerTrigger in the function app every few minutes to monitor the subscription and renew independently of Azure, if it's on a consumption plan?