Subscribe to graph api using logic app

MS Techie 2,681 Reputation points
2023-03-31T12:29:26.4966667+00:00

https://learn.microsoft.com/en-us/graph/api/subscription-post-subscriptions?view=graph-rest-1.0&tabs=http#request

i have subscribed to Graph API to track Azure AD user information , from my logic app.

  1. Now whenever there is any user change, i see that my logic app is triggered 5 times. i feel my logic app should be triggered only once . Please advise
  2. Also when we subscribe to graph api, we cannot stay subscribed for more than 4230 minutes . How can we stay subscribed for ever or atleast 2 years of subscription ?
Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
2,856 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,658 questions
{count} votes

Accepted answer
  1. Anonymous
    2023-04-04T11:28:18.1366667+00:00

    Hi @MS Techie, Thanks for reaching out!

    1. It is a known issue,Update notifications occur on creation and soft deletion of users Subscriptions to changes for user with changeType set to updated will also receive notifications of changeType: updated on user creation and user soft deletion. Can you please check with the changeType and action performed on user?
    2. Yes, Subscriptions in Microsoft Graph have a limited lifetime. Post subscription, the only way to check the expiration remaining is "expirationDateTime"-Specifies the date and time when the webhook subscription expires

    For a list of maximum expiration times, see Maximum length of subscription per resource type documentation. Apps need to renew their subscriptions before the expiration time. Otherwise, they need to create a new subscription. Apps can also unsubscribe at any time to stop getting change notifications. Hope this helps. If the reply is helpful, please click "Accept Answer" and kindly upvote it. If you have additional questions about this answer, please click "Comment".


2 additional answers

Sort by: Most helpful
  1. Nathan Shaw 0 Reputation points
    2023-08-17T19:00:35.93+00:00

    @MS Techie we have been trying to implement this for some time, how were you able to get the logic app to receive the notifications and parse out the validation token during the initial subscription?

    0 comments No comments

  2. SaravananGanesan-3177 1,665 Reputation points
    2023-08-17T19:18:05.31+00:00

    Hi ,

    i hope the below answer will help you .

    1. Multiple Triggers in Logic App: Multiple triggers in your Logic App when using Microsoft Graph API subscriptions could result from retry mechanisms, parallel instances of the app, or multiple subscriptions. Review retry settings, ensure a single subscription, and manage concurrency to address this issue.

    2. Subscription Expiry: Microsoft Graph API subscriptions expire after around 2.95 days to ensure accuracy. For longer-term subscriptions, create a renewal process in your app to extend the subscription periodically. Permanent or multi-year subscriptions are not possible due to the need to reflect changing resource states and permissions.

    0 comments No comments