web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Consume event grid topic in c# project or D365 BAtch job

(0) ShareShare
ReportReport
Posted on by 85

Hi,

Can we consume event grid topic in c# project or D365 Batch job? I am able to publish the events in specified event grid topics now to get all the events.

I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    237,855 Most Valuable Professional on at

    Yes, you can use almost any .NET code from X++. Either you use the API directly from X++, or you'll create a C# library, do more complicated stuff there and provide a simplified interface that you later consume in X++. The latter approach is useful necessary, because .NET Interop from X++ doesn't support things like generic methods or lambda functions.

    As an alternative to writing code, you can use Logic Apps or Power Automate - they come with an Event Grid connector.

    But I wonder why you want to get all events - it's not a normal pattern. Normally you react to individual events, instead of loading all of them at once.

  • Pupadhyay Profile Picture
    85 on at

    Hi Martin,

    Thank for the reply. Can we use D365 sandbox url as a event subscription webhook please confirm 

  • Martin Dráb Profile Picture
    237,855 Most Valuable Professional on at

    You can't. It's not a webhook.

  • Pupadhyay Profile Picture
    85 on at

    Can you please suggest how can we consume the business events in D365 without using Azure function and all ?

  • Martin Dráb Profile Picture
    237,855 Most Valuable Professional on at

    If your question isn't about how to "Consume event grid topic in c# project or D365 BAtch job", please create a new thread and explain your actual question there. Make sure you mention what you're trying to achieve from the business point of view. Are you trying to use business events for some kind of synchronization of two F&O installation, or what?

    If the question about event grid topic has been answered, please mark this thread as such (by using Did this answer your question? > Yes by the reply or replies answering the question).

  • Pupadhyay Profile Picture
    85 on at

    Actually my question is how to consume the event grid topic in D365?

  • Martin Dráb Profile Picture
    237,855 Most Valuable Professional on at

    Then see my first reply in this thread. Ask if something isn't clear.

  • Pupadhyay Profile Picture
    85 on at

    Yes , Actually trying to consume the event grid topic using x++ service/servicegroup and trying to add the service url to event subscription webhook but it is not working . Also I am not sure either it is correct approch or not. This very new for me.

  • Verified answer
    Martin Dráb Profile Picture
    237,855 Most Valuable Professional on at

    We already discussed it above.

    I explained that your solution can't be done and I suggested two ways that *are* possible - either using an integration platform supporting both F&O and Event Grid (Logic Apps / Flow) or writing code using the Event Grid API. It's not clear to me why you keep ignoring these suggestions.

  • Verified answer
    nunomaia Profile Picture
    25 Moderator on at

    Like Martin mentioned there are multiple ways of consuming event grid data, below just a few that I remember. Some of them I already used successfully.

    - Azure Functions ( docs.microsoft.com/.../functions-bindings-event-grid-trigger )

    - Azure Logic Apps docs.microsoft.com/.../monitor-virtual-machine-changes-event-grid-logic-app

    - Azure Power Automate : flow.microsoft.com/.../

    - .NET Library in Dynamics 365 . There were some issues of using it directly in D365. I think they are solved  docs.microsoft.com/.../eventgrid

    Like Martin mentioned, it depends of your business requirements.

    For example, to trigger an action based on an event the last option, most likely the last option would the worst.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 659 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 533 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 289 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans