Integration of Azure machine Learning with Dynamics 365

Today we will talk about the hot topic of the moment: the Artificial Intelligence!
It's not a new topic but it's on the showcase since few weeks.

Now I will focus on some possibilities we have, to implement some custom AI scenarios with our Dynamics 365 platerform (CE in the article but I guess it's pretty similar with other modules).

I did a talk during the MS Experience 2018 in Paris about this topic, and I will share with you what I did / discovered about that topic (which was completely new to me !).

The demo scenario : Win Rate on opportunity

Well I see you coming, "that's a simple and well known scenario". I agree but the point is not to describe a scenario but more how to make Dynamics 365 and the Azure Machine Learning talk to each other.

The process for the demo was pretty simple :

Update your Opportunity record

Flow triggers and gather the needed data and sends it to the Azure Machine Learning with a HTTP Post request.

The Machine Learning gets the data and treats it to give our Win Rate score in return

Flow gets the result from the Machine Learning

The oppportunity record gets updated with the Win Rate score retrieved.

In real action it gives something like :
The win rate changes from 50% to 62.50% after the data "Identify Sales Team" turned to completed since it's one data we are interested in on Machine Learning side.

I won't go in detail about the process with Flow since it has already been detailed in others articles :
Implementing Machine Learning in D365 part 1 and part 2 by Sonoma partners

Other integration possibilities ?

We will have a look to 3 others way (next to flow) which could let you communicate with the Azure Machine Learning and one possibility to improve the data process.

Connect directly with Plugins

Connect with Azure Functions

Connect with Azure Service Bus

Synchronize your data live

I will give you my analysis about each points.

1. Connect directly with Plugins

Advantages :

Keeping the plugin context while sending data to the Azure Machine Learning

Avoiding extra times before the process is triggered since it's a direct trigger

Fully customize the data you can send

Code necessary*

Attention points :

Make sure it's not blocking your synchronous plugin or run it async in order to not stuck the process.

2. Connect with Azure Functions

Advantages :

Out of the box integration with the Plugin Registration Tool since version 9.X and above

Keeping the plugin context while sending data to the Azure Machine Learning

Fully customize the data you can send

Code necessary*

3. Connect with Azure Service Bus

Advantages :

Out of the box integration with the Plugin Registration Tool since version 8.2 and above

Use the same Azure Service Bus message for several usage (multiple apps, multiple systems, ...)

Keeping the plugin context while sending data to the Azure Machine Learning

Fully customize the data you can send

Extra application necessary to integrate the Machine Learning result into the CRM.

Code necessary*

4. Synchronize your data live

You can synchronize your data from the CRM Instance to an Azure SQL Database.
If you want to achieve that the easiest way, you can check in the direction of Data Export Service

In few words, you can select the entities (change tracking needs to be enabled first) to be synchronized (takes milliseconds for a record). It also takes into account the added columns after the first sync is triggered.

I'm speaking of this tool now because it could be really useful to reload the Machine Learning dataset continuously so the prediction would be more and more accurate with the reality of your business !

Code necessary part :

In the previous part of the article, I mentioned the fact that some code are necessary in opposite to Flow to perform the connection between Dynamics 365 and the Machine Learning.

Next steps :

From this point, if you chose the best option to integrate Dynamics 365 and Azure Machine Learning, you could imagine any possible scenario which could add extra value to your business.

Few examples :

Marketing personalization : Based on previous event feedbacks from client, you could use the Machine Learning to improve the personal exchanges and services or products to suggest to your client. He would be treated as an unique client compare to the other.

Sales cross sell & upsell : in order to keep good relationship with your client, you could build something with the Azure Machine Learning by sending all deals done with that clients in the past so you could keep suggesting new job opportunities and products to sell. A great way to keep priviledged relationship with the client.

Service analytics : We all know that the support received by a customer after a purchase is critically important. The AI could help the support teams to gather all common issues from the past and quickly suggest solution, this would save time for the support team and the client will feel lucky to get a quick answer too.

The only limit is your imagination and the time you can allocate to this new project ! :).