首页 > 代码库 > Configure Dynamics 365 and Azure Service Bus Integration (using OneWay relay and listener)

Configure Dynamics 365 and Azure Service Bus Integration (using OneWay relay and listener)

Continuing our previous post

https://nishantrana.me/2017/03/22/configure-dynamics-365-and-azure-service-bus-integration-through-queue-and-queueclient/

Here we‘d add a new Shared Access Policy in the Azure Service Bus.

技术分享

技术分享

We can copy the connection string

技术分享

Paste it in Service Endpoint registration dialog box of Plugin Registration tool

技术分享

Change the designation type to OneWay, use https for the namespace address.

技术分享

Register a step for creation of lead

技术分享

Now we go and create a lead record, which triggers our plugin and creates a system job for it.

技术分享

The system job fails as we do not have any active listener at the end point.

Now let us create a simple windows application which will act as listener.

Basically, we need to implement IServiceEndPointPlugin Interface, create a Service Host, define a new transportclientendpointbehaviour with shared access signature token provider, use WS2007HttpRelayBinding in our service end point.

技术分享

Now run the listener application, and create a lead record in CRM.

We can see the break point hit in our listener application‘ Execute method. Execute method is invoked whenever a message is posted to the service bus by Microsoft Dynamics 365.

技术分享

技术分享

System Job also shows the status as succeeded as we had our listener registered to the endpoint and running.

技术分享

The helpful post

Configure Dynamics 365 and Azure Service Bus Integration (using OneWay relay and listener)