Receiving successful subscription response, but never receiving event notifications

Shawn Broadhead 6 Reputation points
2021-06-29T17:48:42.373+00:00

I'm building an application that will require me to subscribe to calendar events. Before implementing the full application I'm building the example project here https://learn.microsoft.com/en-us/learn/modules/msgraph-changenotifications-trackchanges/1-introduction, but making the changes to subscribe to calendar events instead of user changes as seen here:

var sub = new Subscription();  
sub.ChangeType = "updated";  
sub.NotificationUrl = config.Ngrok + "/api/notifications";  
sub.Resource = $"/users/*user*@*domain*.com/events";  
sub.ExpirationDateTime = DateTime.UtcNow.AddMinutes(60);  
sub.ClientState = "SecretClientState";  
  
var newSubscription = await graphServiceClient  
.Subscriptions  
.Request()  
.AddAsync(sub);  

I'm receiving a subscription and the verification is being displayed when I open the url. In addition, I can look up the subscription on the Graph Explorer using the id and it shows that it's there. Although, oddly, nothing appears when I try to list all subscriptions (I'd really like to know why this is the case as well).

However, when I make changes to the calendar that is referenced in the subscription, I'm not receiving anything. I have not reset ngrok and I'm not receiving any information on the command window that's running ngrok so there's no indication that there's an error there. I've verified that permissions are set to allow for reading and writing of calendar items in the Azure Active Directory application. Is there a way to verify that subscriptions are getting sent or how do I debug this?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,544 questions
{count} vote