Now that we have validated the scope and prerequisites of the connector through part one of this blog series, we are ready to move on to the configuration portion. As both applications reside in the Microsoft Cloud and many of the components required for synchronization messages to be successfully published and polled are already in place within the respective datacenters, the configuration process for setting up the connector with a CRM Online environment is much quicker than a CRM On-Premise environment. The steps required at a high level (and for quick reference) are:

Step 1: (Optional) Create a Service Bus Namespace within Microsoft Azure to house the connector messaging queues.

Step 2: Create a user within the Office 365 tenant where CRM Online resides that will be used as the service account.

Step 3: Import the "Microsoft Dynamics Marketing Connector for Microsoft Dynamics CRM" solution into the CRM instance.

Step 4: Assign the "Dynamics Marketing Connector" security role added by the solution to the service account in CRM.

Step 5: If desired, configure the service account as a "Non-interactive" user in CRM and remove its CRM Online license in Office 365.

Step 6: Enter the relevant configuration criteria into the "Integration Options" page within Dynamics Marketing.

To elaborate on Step 1, you will need access to a Microsoft Azure subscription if you prefer to handle the administration of the Azure portion of the connector configuration rather than leveraging a Microsoft-managed Azure subscription (the "Managed Queues" option is new as of version 18.0).  If you will be making use of your own Microsoft Azure subscription and do not already have one available, you can sign up for a free trial.  Alternatively, if you will be opting to let Microsoft handle the management of the Azure components, then you can move on to the next step.  Keep in mind that the connector only supports ACS-based Service Bus Namespaces at the moment, and a change by the Microsoft Azure team in 2014 disallows their creation from within the portal. Therefore, the Service Bus Namespace that will house the connector messaging queues must be created through PowerShell.

To create the namespace, download and install the Azure pack for PowerShell and then navigate to Start -> Microsoft Azure PowerShell in order to open a PowerShell prompt. From the prompt, type “Add-AzureAccount” and provide the credentials for your Azure subscription to log in. When returned to the prompt, the following cmdlet syntax can be executed to create the Service Bus Namespace:

New-AzureSBNamespace -Name YourNamespace -Location "YourLocation" -NamespaceType Messaging -CreateACSNamespace 1

For example, the cmdlet syntax entered in the screenshot below will create a Service Bus Namespace called “ContosoMDMCRM” in a “Central US” datacenter, though you would want to use the most applicable location for your organization:



When the Service Bus Namespace has been created and you are returned to the PowerShell prompt, make a note of the “DefaultKey” value in the results as we will need this value when we reach Step 6. If you are creating a brand new Service Bus Namespace, you can now move on to the next step. However, if you are going to be using an existing Service Bus Namespace, it’s important to note that it must be set to a Messaging Tier of “Standard”, as the “Basic” tier does not support sessions. You can verify the current Messaging Tier setting by opening the Microsoft Azure Portal, clicking on the Service Bus Namespace that you’ll be using for the connector, and navigating to the “Scale” tab at the top of the page.

For Step 2, you can leverage an already existing account within Office 365 if you so choose. However, please keep in mind that this service account must remain enabled and active for the connector to continue functioning, so a separate account devoted to this functionality is recommended. To create a new account, navigate to the Office 365 Admin Center and log in with an administrative user on the tenant that houses the CRM Online instance that you would like to synchronize records with. Click on Users -> Active Users, then click on the “+” sign to add a new user:



On the resulting “Create new user account” screen, enter the Display Name and User Name you would like to assign the account. If this is an account devoted to this functionality, I recommend using “MDMCRM Connector” and “mdmcrmconnector”, respectively, to ensure that this purpose is clearly visible to all administrators. Once you’ve chosen the name, assign a “Microsoft Dynamics CRM Online Professional” license to the user in order to synchronize the account to your CRM Online organization and click “Create”:



Now that we have a Service Bus Namespace and CRM service account created, we can move on to Step 3. To complete this step, download the Microsoft Dynamics Marketing Connector for Dynamics CRM installer package and execute it to install its contents in a folder of your choosing (the default folder is %PROGRAMFILES%\Microsoft Dynamics Marketing\).

Once the Microsoft Dynamics Marketing Connector for Dynamics CRM is installed on your local workstation, log into the CRM Online environment where the licensed service account resides. Please note that you must log in with a user that’s been assigned the System Administrator security role, as this level of permissions is required to import the connector solution as it contains a security role, SDK message processing steps, and other data necessary to support synchronization.

After you’ve logged in, navigate to Settings -> Solutions and click on Import, then browse to the installation folder where you’ve installed the connector package and into the \Solutions\CRMConnector\ subfolders to select the applicable solution file. The “DynamicsMarketingConnector_for_CRM2013+CRM2011_managed.zip” solution file should be chosen for those installations leveraging CRM 2011 and CRM 2013, while the “DynamicsMarketingConnector_for_CRM2015_managed.zip” solution file should be chosen for CRM 2015 installations.  With the proper solution file selected, click "Import" to begin the importing process and then “Close” one the import is finalized:



Following the import of the solution, Step 4 can be accomplished by navigating to Settings -> Administration -> Users in CRM 2011 or CRM 2013, or by navigating to Settings -> Security -> Users on CRM 2015. From here, click on the service account you created in Step 2 (such as “MDMCRM Connector”) and then click on the “Manage Roles” option at the top of the user profile page to bring up a list of the available security roles. Please note that this option may be within the extended “ellipsis” menu, depending on your screen resolution. On the “Manage Roles” popup window, select the checkbox next to the “Dynamics Marketing Connector” security role and click OK:



If this service account will be used for any CRM operations outside of the connector integration, proceed to Step 6 in order to begin configuring your Dynamics Marketing instance. However, if the service account will strictly be used for the connector, you can now proceed to Step 5 in order to free up the license that has been allocated to the user in Office 365. On the service account user profile page in CRM, scroll to the bottom of the page and expand the “Administration” section. In the “Client Access License (CAL) Information” category, click the Access Mode field and change it from “Read-Write” to “Non-interactive”, then save the changes by clicking on the Save icon in the bottom-right corner of the page.

Now that the user has been switched to be a “Non-interactive” account in CRM, you can return to the Office 365 Admin Center and navigate to Users -> Active Users, click on the row containing the service account user to highlight it, and click “Edit” under “Assigned License” in the pane to the right. From here, simply remove the checkbox from the Microsoft Dynamics CRM Online license and click Save to free the license up for another user:



At this point, we are ready to move on to Step 6 and finalize the connector setup within Dynamics Marketing. To do so, log into Dynamics Marketing with an administrative user and navigate to Settings -> Integration Options. By default, the Status should display an “Operation completed successfully.” message and the mode listed under the “CRM Endpoint” section should be set to Online. Our first step will be to verify that the "CRM Mode" is set to "Online" (if set to "On-Premise", click the "Connect to CRM Online" icon to switch it), then we can proceed to the CRM configuration by clicking on the “gear” icon in the “CRM Endpoint” section and entering our CRM Online URL, as well as the service account credentials:



You can click the Verify button in order to ensure that the user is able to authenticate, then click Submit to save the changes. Next, we will click the “gear” icon in the “Service Bus” section. The window that opens at this point involves a two-step process, the first of which is to choose whether you would like for Microsoft to manage the Azure portion of the connector configuration for you ("Managed Queues") or if you would prefer to handle the administration of the Azure portion of the connector configuration under your own subscription ("Custom Queues").

If you choose the "Managed Queues" option, you can simply click Next to proceed to the next screen as no Azure-related information (or Azure subscription) is required for the connector setup. However, if you choose the "Custom Queues" option, you must enter the Service Bus Namespace and queue names from your own Azure subscription that you would like to use for synchronization messages that will be sent from CRM to Dynamics Marketing and from Dynamics Marketing to CRM before clicking Next. The recommended queue names are “crm2mdm” and “mdm2crm”, respectively, but the names are ultimately up to you as long as they are unique to the namespace:



For the purposes of this blog article, we will be choosing "Custom Queues", which will bring us to the second set of fields. The initial “Management Key” field should be populated with the “DefaultKey” value that we noted back in Step 1. If you are unsure which key to use, you can also obtain it by opening the Microsoft Azure Portal, highlighting the Service Bus Namespace that you created for the connector, and clicking on “Connection Information” at the bottom of the page.

For CRM Online, the “Dynamics CRM Certificate Issuer Name” will be consistent across all setups and will depend on where your organization is hosted. For example, customers with a CRM Online instance hosted in North America will use “crm.dynamics.com”. This value as well as the “Dynamics CRM Service Certificate” can be obtained by logging into the CRM instance and navigating to Settings -> Customizations -> Developer Resources. On this page, the value we will need is the “Issuer Name” under the “Windows Azure Service Bus Issuer Certificate” section and we will also need to download the certificate immediately below this line:



After the issuer name is populated and the certificate has been uploaded, the CRM Account and Password fields should be populated with the credentials of a CRM user with the System Administrator or System Customizer security role as this user account will be used to create the Service Endpoint and SDK Message Processing steps necessary to handle the connector communication within CRM:



With this data populated, click OK to add these elements to the CRM instance, then click Submit to return to the Integration Options page. At this point, the MDM Listener, MDM Publisher, and CRM Listener services should be in a “Running” state on the page, though you may need to refresh the page to see the immediate impact of the configuration. 

From here, we can now perform a health check by clicking on the “right arrow” icon in the "Health Check" section. This check is entirely optional, but is recommended as it will verify that a message can be sent from Dynamics Marketing to CRM and back again. A log will be generated if any failure occurs during this check, so if no log can be downloaded after it is complete, that is an indication of success.

As a final step, the mapping configuration on the Integration Options page should be verified to ensure that the default configuration suits your business needs. I have covered our mapping configuration setup and options in the fourth installment to this blog series, as well, in the event that more advanced customizations are needed. Beyond this, I also want to note that marketing lists do not synchronize from CRM to Dynamics Marketing by default. To synchronize your marketing lists to Dynamics Marketing, you will first need to edit the respective form(s) in CRM by navigating to Settings -> Customizations -> Customize the System -> Entities -> Marketing List -> Forms, opening the form(s) into the form editor window, adding the custom “Sync Enabled” field to it/them, and then saving/publishing the change. After this is complete, the field will appear on marketing list records in CRM and the value can be changed to “Yes” for those lists that should be synchronized with Dynamics Marketing.

With the entirety of our configuration now complete, we are ready to perform an Initial Synchronization to mirror the records between the two environments. As it is somewhat resource-intensive across both applications, it is recommended that an Initial Synchronization be performed outside of normal business hours if you have a significant number of records in either environment. To begin the process, click the “right arrow” icon in the right area of the Initial Synchronization section and click “Yes” at the resulting window to acknowledge the prompt. At this point, the status will change to “In Progress” and the “Result” value will begin incrementing on a periodic basis to reflect the total number of records sent between the two environments. When the Initial Synchronization is finished, the status will change to “Complete”:



At this point, records from all entities that were enabled for synchronization should be present in both environments. All records that flowed from Dynamics Marketing to CRM will be owned by the service account that we set up in CRM, while all records that flowed from CRM to Dynamics Marketing will be owned by a custom “CRM SYNCHRONIZATION ACCOUNT” integration user.

For additional information on configuring the connector or its mappings, please refer to our TechNet article - "Connect Microsoft Dynamics CRM 2013 and 2015 with Microsoft Dynamics Marketing".