Monday, January 15, 2018

CRM- SQL server integration using Logic apps

It has been a long time since my last blog. I am thinking of doing a few more blogs about Logic Apps this year.  The best thing about Logic Apps are the number of connectors available out of the box to connect to different applications. With the enterprise integration account, Logic Apps can implement enterprise patterns and scenarios similar to BizTalk server.

This is the first blog of the series. In this blog, I will integrate D365 online with SQL server on premise using Logic Apps.

Solution components

2018-01-16_11-29-22

Steps

This is very simple integration scenario. This Logic App will poll Dynamics 365 for new contact records and insert a row in the on premise SQL Server table named Customer.
  1. Setup an on-premise Data Gateway. The following link provides the step by step instruction to setup a gateway.
    https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-gateway-connection
    Note: Consider latency while selecting the region for the gateway
  2. Create a new Logic App. Check my old blog for screenshots of steps to get to the Logic App designer.
  3. Select a Dynamics 365 connector and select Dynamics 365 - When a new record is created.
    2018-01-15_22-34-33

  4. Enter the username and password to connect to your D365 organisation.
  5. Select the Organization Name, Entity Name, Interval and Frequency as shown below. The fields Interval and Frequency are very important. It will define how often the Logic App will poll D365 for new records.
    2018-01-15_22-52-42

  6. Add a New step and choose Add an action.
    2018-01-15_22-57-29
  7. Choose SQL Server >> SQL Server - Insert row.
    2018-01-15_22-59-51

  8. Enter the connection information as shown in the screen shot below. Make sure On Premise data gateway is checked and select the gateway created in step 1 of the blog.
    2018-01-15_23-13-17

  9. If the connection is successful, select the name of the table and map the column names with the CRM field names.
    2018-01-15_23-20-04

  10. The output of this action can be used to perform further action. For this blog, I am not doing anything with the output. Save the Logic App and test it by creating a record in CRM.
  11. I ran some tests and here is the Run history of the app. After the initial run, the average time to process a record is sub 3 seconds, which is quite good considering my machine is Australia and Logic App is hosted in the US West region.
    2018-01-16_11-47-05












2 comments:

  1. Good stuff! Kanhasoft is the leading web and mobile application development company. Our expertized technologies are PHP, Java, Python, Laravel, CodeIgniter, Yii, iOS, Android, .Net and Django. We offer IT solutions to offshore Clients from USA, UK, Canada, Japan, Norway, Germany, Australia, South Africa and 45 more. We help businesses to boost sales through CRM software development, Amazon seller API development, ERP Development and more.

    ReplyDelete
  2. Add a post about how Microsoft CRM can be integrated and small company can use it to expand their customer relations.

    ReplyDelete