Usually message queuing requires software development however in this blog post I am going to show you how events, such has creating an account, in Dynamics 365 can put messages on a queue without the need for any code. On top of that you can provide a third party with access to read messages from the queue from anywhere without configuring any firewalls or ports. This can be accomplished by using Azure Service Bus which is a cloud based messaging service which supports a number of different messaging techniques including queues.
The first thing you need to do is to create a queue in Service Bus from the Azure Portal as shown.
Once the queue is created select the Shared Access policies option to create a policy that will allow Dynamics to put messages on the queue.
We need to create policy with Send rights only
Once you have saved the SAS policy then copy the connection string to the clipboard as we will need it when we register the queue’s endpoint in Dynamics.
Now that your queue and SAS policy are created you need to use the Dynamics Plugin Registration tool to connect to your Dynamics enviroment. Once connected select the Register New Endpoint option and paste in the connection string.
Click Next and your Service Point Details are displayed having being populated from the connection string. You need to select which message format you want to use. Json and Xml are the best formats at interopability between third party systems.
Now that the Service Bus endpoint is registered you can register a step so that an event in Dynamics will post details of the event onto the Service Bus message queue. Note: You can only register the step’s Execution Mode as Asynchronus. In the example here the creation of an account will cause the execution contect of the event to be serialized in endpoint’s selected message format.
You can download a useful tool called the Service Bus Explorer from Github here that allows you to view the messages on a service bus queue. I have used it to view the message in Json format that was created when an account was created.
So here you have seen that in a number of easy steps how you can configure Dynamics to put event messages on a Service Bus message queue. If you wanted a third party to read these messages you would create another SAS policy that has read rights to the queue and give this to your third party. As the Azure service bus runs in the cloud your third party can access the queue from anywhere by providing the SAS credentials.
Leave A Reply
You must be logged in to post a comment.