Microsoft Dynamics CRM Integration With BizTalk: The How-To Guide


Microsoft Dynamics CRM 2015 is the most recent addition to Microsoft’s business applications platform and we have seen a lot of people wondering about how it can be integrated to the Biztalk server since the solution is very much in demand. The best part of Microsoft dynamics CRM integration with BizTalk is that you can leverage the rich set of features of Microsoft dynamics CRM by by integrating with the prevalent lines of the business systems that are available on premise.

Overview of the integration:

Microsoft Dynamics CRM online provides the Organization Service aka IOrganizationService which is a built-in CRM WCF service that is used to interrelate the CRM data and meta data (CRM onlineIOrganizationServiceBiztalk(app1, app2). In order to execute this solution, you need:

• MS Dynamics CRM account
• BizTalk server 2013

Synopsis of the solution:

a. Retrieve the Organization Service URL from CRM online organization instance.
b. Generate schema from the Organization Service web service using BizTalk WCF Service Consuming Wizard.
c. Create Source Schema (Account Schema)
d. Link source schema to MS dynamics CRM online schema.
e. Build Orchestration (Account orchestration)
f. Create binding and behavior and register them in BizTalk.
g. Configure WCF custom send port.
h. Configure BizTalk.
i. Drop the account sample file in predefined folder to simulate sending messages.
j. Verify the account in CRM online.

The step by step guide using organization service to Microsoft dynamics CRM online:

Step 1: Retrieve Organization Service URL from Microsoft Dynamics CRM online.
Go to Settings  Customizations  Developer Resources

Step 2: Generate the schema and binding file using BizTalk WCF Service Consuming Wizard.
BizTalk Solution  Right click Scheme project  Add  Add generated items  Consume WCF service wizard  enter the URL of your Dynamics service end point  Get  Next  Import

Step3: Replace the Organization Service schema with BizTalk schemas with BizTalk schemas that are provided through CRM SDK (SDK/Schemas/CRMBizTalkIntegration)

Step 4: Create account schema.

Step 5: Map account schema with CRM schema.

Step 6: Create orchestration in BizTalk. The orchestration is receiving the message via “rcvAccountPort;” it then uses “Construct Message” shape to map the message received to the expected Organization Service schema and sends it to CRM. The response message is captured and written to the file system.

Step 7: Deploy BizTalk artifacts to BizTalk.

Step 8: Configure Organization Service send port.
Import the binding configuration (OrganizationService_Custom.BindingInfo) generated in Step-2. Rename the port from auto generatedWcfSendPort_OrganizationService_CustomBinding_IOrganizationService_Custom to OrganizationService.

CRM Online is using Windows Live Id authentication. In order to configure the BizTalk send port to authenticate with CRM Online instance, a custom WCF behavior has to be built and registered in the Global Assembly Cache (GAC) and the configuration file (machine.config or in BizTalk WCF-Custom send handler).

Step 9: Start BizTalk application.

Drop the sample file that contains account-related information in the predefined incoming folder.
Verify the account in Microsoft dynamics CRM online and Verify the response is received in the expected file system folder.