Search code examples
azure-functionsmicrosoft-graph-apimicrosoft-teamsmicrosoft-graph-teamschange-notification

Azure change notification for CallRecords: lifecycle notification doesn't work for me


I registered a subscription for callrecord.

I tried many, I started with a locally C# app with ngrok and then I used an Azure function with nodejs. Creating the subscription locally without lifecycle notification works fine, creating a subscription with an Azure function with nodeJS works fine too with both urls (notification & lifecycle).

For the post call I used the following JSON:

{
   "resource": "communications/callRecords",,
   "changeType": "created",
   "clientState": "xyz",
   "notificationUrl": "https://<domain>/api/notificfation",
   "lifecycleNotificationUrl": "https://<domain>/api/lifecylcenotificfation",
   "expirationDateTime": "2021-08-29T16:36:56.1624377Z",
} 

The registered Azure function for both url's uses the following code:

module.exports = async function (context, req) {
    context.log('Executing Webhook endpoint...');

    // Validate the subscription creation
    if (req.query.validationToken) {
        context.log('Validating new subscription...');
        context.log('Validation token:');
        context.log(req.query.validationToken);
        context.res = {
            headers: {
                'Content-Type': 'text/plain'
            },
            body: req.query.validationToken
        };
    }
    else {
        context.log('Received new notification...');
        context.log('Notification: ');
        context.log(JSON.stringify(req.body));
        context.res = { body: "" };
    }
};

The problem is not to get the callrecords, but in misbehaviour or something I don't know I got no lifecycle notifications.

I tried waiting of expiration, blocking the notification url, delete the app registration, changed/delete the secret, remove necessary API permission.

I waited more than half day i think 5-6 hours as reaction time for lifecycle notification, but I got no lifecycle notification.

Can someone tell me what goes wrong?


Solution

  • Have a look at this documentation - Reduce missing subscriptions and change notifications.

    It is mention that-

    Lifecycle notifications are supported for subscriptions created on these resource types:

    • Outlook message
    • Outlook event
    • Outlook personal contact
    • Teams chatMessage