Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Unanswered

Custom workflow/plugin synchronous data flow over Azure Service Bus to a backend system

Posted on by 10

Hi,

I am new to the forums, and by no means a CRM specialist but rather an Enterprise Service Bus architect, with a troublesome problem I need to solve.

Customer already has a D365 CRM production tenant with an integration to their backend agreement management system (here system "A"). This is accomplished by a plugin that sends all updates on a specified entity to Azure Service Bus in an asynchronous manner. The ASB queue is read by a Logic Apps which then sends the message furthermore from the cloud towards the onpremise system A. Return values from A are retrieved by the Logic Apps code but as we have no session to send this info back to CRM it is descarded.

This introduces a business problem where an agreement related information (agreement party) is handled in CRM and the channel between A and CRM is not reliable. This means that A managing the agreements may have older information about the parties than CRM.

To overcome this, my thougth is to make the plugin action synchronous so that we await for the system A answer, and only then commit/save the update action on CRM entity. Or the other way around, in case of unsuccessful return code from A, we revert the update to the entity on CRM we just did and notify end user about the status of the transaction.

What I need is pretty closely explained here (well, the part 4: Two Way is what I wanted the most but can't find it):

[edit] found the part 4 just after posting this. reading.. ;)

https://community.dynamics.com/crm/b/crmviking/posts/microsoft-crm-azure-service-bus-part-3-creating-a-relay-service-and-endpoint

From this article I fail to understand the role of "Creating a one-way relay". Where is this code supposed to be run on? On box level if I can replace this code with my LogicApps ASB reader/https-sender -code then I think I perhaps understand how I should make a synchronous flow over systems CRM and "A".

How would you make a synchronous link over to an external system?

Kind regards,

Timo

  • Timo karhu Profile Picture
    Timo karhu 10 on at
    RE: Custom workflow/plugin synchronous data flow over Azure Service Bus to a backend system

    Answer is: create the listener with Azure Web Jobs.

  • Timo karhu Profile Picture
    Timo karhu 10 on at
    RE: Custom workflow/plugin synchronous data flow over Azure Service Bus to a backend system

    Hi Kokulan,

    thank you for your point. This is where the customer comes from. Not now seeing the actual state (async), they'd rather wait for timeout value to get the real status if the submitted change has reached the end target successfully.

    Looks like this is not doable with Azure cababilities so I need to ask the customer how bad they really want a synchronous flow.

  • Kokulan Profile Picture
    Kokulan 18,048 on at
    RE: Custom workflow/plugin synchronous data flow over Azure Service Bus to a backend system

    Hi

    one thing I thought worth mentioning here when you develop a two-way comm in a sync plugin/workflow is that it will hold up the UI and it may notbe good for user experience in CRM. You can only find out how much it affects by doing some tests.

  • Timo karhu Profile Picture
    Timo karhu 10 on at
    RE: Custom workflow/plugin synchronous data flow over Azure Service Bus to a backend system

    Thanks David.

    I believe I've captured my understanding to a point which is described here: docs.microsoft.com/.../gg334766(v=crm.8)

    This clearly depicts what is my problem. I need the listener - "3rd party service" in the picture - to be in Azure (Logic App preferably) but I fail to understand where in Azure should I try to make the suggested sample .NET code (TwoWay or REST listeners) to run on.

    From this logic app I would then establish an outbound https request elsewhere (this part already exists).

  • David Jennaway Profile Picture
    David Jennaway 14,063 on at
    RE: Custom workflow/plugin synchronous data flow over Azure Service Bus to a backend system

    The fundamental point of a relay is to make a reliable connection - i.e. so that the calling code in the plugin knows that the message has been receive, and the two-way relay allows for a useful return value.

    The ServiceEndpoint code will run on the Azure Service Bus. For your scenario I'd see this as being a wrapper around your existing LogicApps ASB reader

    You'll also need to handle system failure scenarios. The main ones are:

    • Communication failure to the Azure Service Bus. This should get thrown as an Exception in the plugin when you call the Service Bus
    • Timeouts. There will be several timeouts in the overall communication. At the D365 end there is an overall timeout of (I think it's still the case) 120 seconds for a plugin to complete execution

    By default an unhandled exception in a synchronous plugin will cancel the calling operation

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans