Using Microsoft Azure Auto Machine Learning, Logic App and Dynamics 365 for AI Predictive Customer Service

Simon Harris
Oct 24 · 4 min read

Microsoft Azure Machine learning has the potential to automate Customer Service in Dynamics 365. I wanted to see if I could use Azure Machine Learning to help customer service agents predict the most likely fault for a product when a customer contacts them.

3 areas of configuration will be covered:

  • Azure Automated Machine Learning — to predict faults
  • Dynamics 365 — to capture product and age and show prediction
  • Azure Logic App — to glue the above together

Azure Automated Machine Learning

  1. I created a csv file of faults (this would normally come from the customer’s Dynamics 365 or data warehouse based on historical fault data). 3 fields specified: Product, Age and Fault. Expectation was each row would have been a real reported product fault.
example csv file of faults

2. In Azure I created a new ‘Machine Learning service workspace’

3. I then clicked ‘Create a new Automated Machine Learning Model’

4. I selected my CSV file

5. I picked Fault column as the target and accepted Categorisation

6. Run the automation — review of models/types

7. When finished I clicked deploy Best Model

Dynamics 365

8. I created a demo Dynamics 365 instance

9. I added the products from my Fake faults csv file to Dynamics

10. I added a new field to the Case entity and form to capture product age; and one field to receive the AI predicted Fault

11. I added the fields to the Case form

12. Publish all customisations

Azure Logic App

13. I created a new Logic App

14. Trigger point was when case updated using Common Data Service

15. I used a Get record to obtain the Product Name from the Product Id — needed for AI prediction

16. I initialised a Variable to store the Product Name for later use

17. I then used a HTTP action to call the Azure Machine learning deployment API, passing the Product Age and Product Name in. URI was obtained from the Automated Machine Learning. Be careful to have square brackets after “data”:

18. Then a Parse JSON action to retrieve the Predicted Fault

19. Finally, an Update a record action from Common Data Service to write the AI predicted Fault into the Case record


1. Click Run in the Logic app

2. Create a new Case record in Dynamics 365

3. Set the Title, Customer, Product and Product Age

4. Save the Record, which triggers the Logic App

5. Refresh Dynamics 365 and see the Predicted Fault from Azure Machine Learning set in the Dynamics 365 field


Originally, I followed on-line examples of manually creating the experiment and setting the import data steps, split data, test, evaluate, etc. This worked OK. However, when I tried to deploy the predictive model, I had problems. The deployment step refused to ‘see’ my newly created Kubernetes cluster. I then moved to using Azure Automated Machine Learning, which worked well with minimal input.

I found the HTTP action step of the Logic App quite frustrating. I couldn’t find any examples of the syntax needed for the JSON body and it took help from a colleague to realise I needed ‘[‘ after data instead of ‘{‘.

Overall, I think this is quite impressive to be able to load existing customer data into Machine Learning and link this to Dynamics 365 without any code and with minimal effort.

Join the Capgemini Microsoft team, open roles

Capgemini Microsoft team

To share best practices, knowledge and experiences of the Capgemini Microsoft team

Simon Harris

Written by

CRM Architect for Capgemini UK

Capgemini Microsoft team

To share best practices, knowledge and experiences of the Capgemini Microsoft team

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade