0

I am using the MS graph subscription endpoint (https://graph.microsoft.com/v1.0/subscriptions) to add a subscription on a calendars events for some of my end users outlook accounts. For some accounts (not all) this fails with this error:

{
  "error": {
    "code": "ExtensionError",
    "message": "Operation: Create; Exception: [Status Code: ServiceUnavailable; Reason: Target resource 'xxxx-xxx-xxx-xxxx' hosted on database 'xxxx-xxx-xxx-xxxx' is currently on backend 'Unknown']",
    "innerError": {
      "date": "2021-05-31T08:27:37",
      "request-id": "c7c38d7a-617c-4601-9684-0f924e86248a",
      "client-request-id": "c7c38d7a-617c-4601-9684-0f924e86248a"
    }
  }
}

Just before adding the subscription my code have been able to add a new event to the same calendar, so I think that my access token has the right permissions to access the calendar. So I don't understand how I can get an "ExtensionError"?

Here is the C# code that I run to try to add the subscription:

var subscription = new Subscription
{
    ChangeType = "created,updated,deleted",
    NotificationUrl = GetNotificationUrl(),
    Resource = $"me/calendars/{calendarId}/events",
    ExpirationDateTime = DateTimeOffset.Now.AddHours(70),
    ClientState = clientState,
};

await graphServiceClient
    .Subscriptions
    .Request()
    .Header("Prefer", $"IdType=\"ImmutableId\"")
    .AddAsync(subscription);
jbiversen
  • 371
  • 3
  • 14
  • (1) Try isolate the issue out of your code, by making the same call in POSTMAN/Graph Explorer (2) Enable NGROK to see if it provides more insight (3) If issue persists or intermittent, it sounds like a service issue by looking the error. Consider opening support ticket at Office portal, so that they can investigate. – Dev Jun 02 '21 at 04:13
  • Also i found a [related thread too](https://stackoverflow.com/questions/55292161/microsoft-graph-subscription-extensionerror-delete-update) – Dev Jun 02 '21 at 04:13

0 Answers0