Walkthrough: Preparing to install the DCRM connector in a container environment
To prepare for adding Sitecore Connect for Microsoft Dynamics 365 for Sales (DCRM) to your container installation, regardless of whether you are deploying to Docker or Azure Kubernetes Service, follow the steps in this walkthrough.
This walkthrough describes how to:
-
Prepare the installation files.
-
Build the Docker images.
Prepare the installation files
To prepare the files you need for the installation:
-
Download the DCRM container deployment package from the Sitecore download page. Extract it to your local workstation with the folder structure intact.
-
Go to the folder that you extracted the DCRM container deployment package to. Go to the folder for the Windows version and topology you are using, for example,
dcrm\compose\ltsc2019\xp1. -
Open the
.env-examplefile in an editor. Copy all the variables to the clipboard. -
Go to the Sitecore Experience Platform (SXP) container deployment folder on your local machine. Go to the folder for the Windows version and topology you are using, for example,
compose\ltsc2019\xp1. -
Open the
.envfile in an editor, and paste in the variables from the DCRM.env-examplefile. -
Fill in the parameters for the following variables:
-
ConnectionString_DCRM -
ConnectionString_StagingDB
-
-
Add the following variables to the
.envfile:RequestResponseDEF_IMAGE=scr.sitecore.com/sxp/modules/sitecore-def-xp1-assets:8.0.0-1497 DCRMCNN_IMAGE=scr.sitecore.com/sxp/modules/sitecore-dcrm-xp1-assets:8.0.0-1497 TOOLING_IMAGE=scr.sitecore.com/tools/sitecore-docker-tools-assets:10.3.0-1809 -
Save the
.envfile. -
From the DCRM
compose\<version>\<topology>folder, copy thedocker-compose.override.ymlfile to the SXP container deploymentcompose\<version>\<topology>folder (where thedocker-compose.ymlfile is).
Build the Docker images
When you have prepared the installation files, you must create Docker files for each role, and build the Docker images.
For more information on image assets, see the documentation on how to Add Sitecore Modules.
To build the images:
-
Go to the SXP container deployment folder on your local machine. Go to the folder for the Windows version and topology you are using, for example,
compose/ltsc2019/xp1. Create a subfolder and name itmodule. -
In the
modulefolder, create these subfolders:-
cm -
xconnect -
xdbsearchworker -
mssql-init
-
-
In each subfolder, create a new file and name it
Dockerfile. -
In the
cmfolder, in theDockerfilefile, enter the following instructions:RequestResponse# escape=` ARG BASE_IMAGE ARG DCRMCNN_IMAGE ARG DEF_IMAGE ARG TOOLING_IMAGE FROM ${DEF_IMAGE} as def FROM ${DCRMCNN_IMAGE} as dcrm FROM ${TOOLING_IMAGE} as tooling FROM ${BASE_IMAGE} as baseImage SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] WORKDIR C:\inetpub\wwwroot # Add DEF module COPY --from=def \module\cm\content # Add DCRM module COPY --from=dcrm \module\cm\content #Copy transformation files COPY --from=dcrm \module\xdttransform\cm\transforms\ C:\transforms\ #Add tools from sitecore-docker-tools-assets COPY --from=tooling \tools\ C:\tools\ RUN C:\tools\scripts\Invoke-XdtTransform.ps1 -Path C:\inetpub\wwwroot -XdtPath \transforms\cm -
In the
xconnectfolder, in theDockerfilefile, enter the following instructions:RequestResponse# escape=` ARG BASE_IMAGE ARG DCRMCNN_IMAGE ARG TOOLING_IMAGE FROM ${DCRMCNN_IMAGE} as dcrm FROM ${TOOLING_IMAGE} as tooling FROM ${BASE_IMAGE} as baseImage SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] #Add tools from sitecore-docker-tools-assets COPY --from=tooling \tools\ C:\tools\ # Copy models file into index worker COPY --from=dcrm \module\models C:\inetpub\wwwroot\App_Data\Models\ #Copy transformation files COPY --from=dcrm \module\transforms\ C:\transforms\ # Update value for IndexPIISensitive and IndexAnonymousContactData in IndexerSetting RUN C:\tools\scripts\Invoke-XdtTransform.ps1 -Path C:\inetpub\wwwroot -XdtPath C:\transforms\xconnect -
In the
xdbsearchworkerfolder, in theDockerfilefile, enter the following instructions:RequestResponse# escape=` ARG BASE_IMAGE ARG DCRMCNN_IMAGE ARG TOOLING_IMAGE FROM ${DCRMCNN_IMAGE} as dcrm FROM ${TOOLING_IMAGE} as tooling FROM ${BASE_IMAGE} as baseImage SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] #Add tools from sitecore-docker-tools-assets COPY --from=tooling \tools\ C:\tools\ #Copy transformation files COPY --from=dcrm \module\transforms\ C:\transforms\ # Update value for IndexPIISensitive and IndexAnonymousContactData in IndexerSetting RUN C:\tools\scripts\Invoke-XdtTransform.ps1 -Path C:\service -XdtPath C:\transforms\xdbsearchworker -
In the
mssql-initfolder, in theDockerfilefile, enter the following instructions:RequestResponse# escape=` ARG BASE_IMAGE ARG DCRMCNN_IMAGE FROM ${DCRMCNN _IMAGE} as dcrm FROM ${BASE_IMAGE} SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] # Deploy DCRM Staging database file COPY --from=dcrm C:\module\db C:\resources\dcrm -
In the
compose\<version>\<topology>\docker-compose.override.ymlfile, add build instructions for each role. For all topologies, start with these instructions:RequestResponseversion: "2.4" services: cm: image: sitecore-dcrm-xp1-cm:${SITECORE_VERSION} build: context: ./module/cm args: BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-xp1-cm:${SITECORE_VERSION} DEF_IMAGE: ${DEF_IMAGE} DCRMCNN_IMAGE: ${DCRMCNN_IMAGE} TOOLING_IMAGE: ${TOOLING_IMAGE} mssql: image: sitecore-dcrm-xp1-mssql:${SITECORE_VERSION} build: context: ./module/mssql args: BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-xp1-mssql:${SITECORE_VERSION} DEF_IMAGE: ${DEF_IMAGE} DCRMCNN_IMAGE: ${DCRMCNN_IMAGE} xdbsearchworker: image: sitecore-dcrm-xp1-xdbsearchworker:${SITECORE_VERSION} build: context: ./module/xdbsearchworker args: BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-xp1-xdbsearchworker:${SITECORE_VERSION} DCRMCNN_IMAGE: ${DCRMCNN_IMAGE} TOOLING_IMAGE: ${TOOLING_IMAGE}If you are deploying XP0, add instructions for
xconnect:RequestResponsexconnect: image: sitecore-dcrm-xp0-xconnect:${SITECORE_VERSION} build: context: ./module/xconnect/ args: BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-xp0-xconnect:${SITECORE_VERSION} DCRMCNN_IMAGE: ${DCRMCNN_IMAGE} TOOLING_IMAGE: ${SITECORE_TOOLS_REGISTRY}sitecore-docker-tools-assets:${TOOLS_VERSION}If you are deploying XP1, add instructions for
xdbsearchandxdbcollection:RequestResponsexdbsearch: image: sitecore-dcrm-xp1-xdbsearch:${SITECORE_VERSION} build: context: ./module/xconnect args: BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-xp1-xdbsearch:${SITECORE_VERSION} DCRMCNN_IMAGE: ${DCRMCNN_IMAGE} TOOLING_IMAGE: ${TOOLING_IMAGE} xdbcollection: image: sitecore-dcrm-xp1-xdbcollection:${SITECORE_VERSION} build: context: ./module/xconnect args: BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-xp1-xdbcollection:${SITECORE_VERSION} DCRMCNN_IMAGE: ${DCRMCNN_IMAGE} TOOLING_IMAGE: ${TOOLING_IMAGE} -
In the Windows console, go to the folder containing the
docker-compose.override.ymlfile. Run the commanddocker-compose build. -
If you are deploying to Docker, continue with the instructions in Add the DCRM connector module to Sitecore in Docker.
If you are deploying to Kubernetes, continue with the instructions in Walkthrough: Adding the DCRM connector module to Sitecore in Azure Kubernetes Service.
Some modifications to Sitecore deployments, such as adding connection strings or changing the web configuration files, require you to use configuration transforms to change the configuration files. For information on how to apply configuration transforms, see the Sitecore container development documentation.