Configure Dynamics 365 and Azure Service Bus Integration (using TwoWay relay, Azure Aware Plugin and...

Let us pick up from where we left in the previous post and implement two way relaying through which we can get the response back from the listener.

https://nishantrana.me/2017/03/22/configure-dynamics-365-and-azure-service-bus-integration-using-oneway-relay-and-listener/

First let us update the Service Endpoint Registration, change the designation type to TwoWay, it would also ask to enter the SAS Key. Copy it from Azure and paste it.

Configure Dynamics 365 and Azure Service Bus Integration (using TwoWay relay, Azure Aware Plugin and...

Configure Dynamics 365 and Azure Service Bus Integration (using TwoWay relay, Azure Aware Plugin and...

Update the listener windows application created in the previous post to implement ITwoWayServiceEndpointPlugin

Configure Dynamics 365 and Azure Service Bus Integration (using TwoWay relay, Azure Aware Plugin and...

Use the below code to create the custom azure aware plugin.

Configure Dynamics 365 and Azure Service Bus Integration (using TwoWay relay, Azure Aware Plugin and...

Get the service endpoint id from the Properties window of the Service End Point registered.

Configure Dynamics 365 and Azure Service Bus Integration (using TwoWay relay, Azure Aware Plugin and...

Register the assembly and add the Post Create Synchronous Lead Step to it.

Configure Dynamics 365 and Azure Service Bus Integration (using TwoWay relay, Azure Aware Plugin and...

As we are using trace service to log the response, set All for Enable logging to plugin-trace log option from Administration – System Setting – Customization.

Configure Dynamics 365 and Azure Service Bus Integration (using TwoWay relay, Azure Aware Plugin and...

Start the listener windows application and to trigger the plugin, create the lead record

Configure Dynamics 365 and Azure Service Bus Integration (using TwoWay relay, Azure Aware Plugin and...

We can see the execute method being called from Azure Service bus on create of Lead record.

Configure Dynamics 365 and Azure Service Bus Integration (using TwoWay relay, Azure Aware Plugin and...

Configure Dynamics 365 and Azure Service Bus Integration (using TwoWay relay, Azure Aware Plugin and...

The message being returned from listener application to the plugin.

Configure Dynamics 365 and Azure Service Bus Integration (using TwoWay relay, Azure Aware Plugin and...

The newly created lead record.

Configure Dynamics 365 and Azure Service Bus Integration (using TwoWay relay, Azure Aware Plugin and...

The trace message within the plugin –

Configure Dynamics 365 and Azure Service Bus Integration (using TwoWay relay, Azure Aware Plugin and...

Plugin Trace log with the response received from the listener –

Configure Dynamics 365 and Azure Service Bus Integration (using TwoWay relay, Azure Aware Plugin and...

Hope it helps..