Walkthrough: Preparing to install the SFCRM connector in a container environment
To prepare for adding the Sitecore Connect for Salesforce CRM connector (SFCRM) 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 SFCRM 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 SFCRM container deployment package to. Go to the folder for the Windows version and topology you are using, for example,
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 SFCRM.env-examplefile. Replace the default value forMYSF_CONNECTIONSTRINGwith the connection string you prepared in ???. -
From the SFCRM
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 Sitecore 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 folder and name itmodule. -
In the
modulefolder, create these subfolders:-
cm -
xconnect -
xdbsearchworker
-
-
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 SFCRM_IMAGE ARG DEF_IMAGE ARG TOOLING_IMAGE FROM ${DEF_IMAGE} as def FROM ${SFCRM_IMAGE} as sfcrm 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\ FROM baseImage as defsfcrm # Add DEF module COPY --from=def \module\cm\content C:\inetpub\wwwroot # Add SFCRM module COPY --from=sfcrm \module\cm\content C:\inetpub\wwwroot #Copy transformation files COPY --from=sfcrm \module\xdttransform\cm\transforms\ C:\transforms\role # Add SFCRM connection strings in Sitecore config file RUN C:\tools\scripts\Invoke-XdtTransform.ps1 -Path C:\inetpub\wwwroot -XdtPath C:\transforms\role #Enable loadUserProfile to allow CMS to connect to salesforce RUN C:\windows\System32\inetsrv\appcmd.exe set config -section:system.applicationHost/applicationPools /applicationPoolDefaults.processModel.loadUserProfile:"true" /commit:apphost; -
In the
xconnectfolder, in theDockerfilefile, enter the following instructions:RequestResponse# escape=` ARG BASE_IMAGE ARG SFCRM_IMAGE ARG TOOLING_IMAGE FROM ${SFCRM_IMAGE} as sfcrm 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=sfcrm \module\xconnect\content C:\inetpub\wwwroot #Copy transformation files COPY --from=sfcrm \module\xdttransform\xconnect\transforms\ C:\transforms\role # Update value for IndexPIISensitive and IndexAnonymousContactData in IndexerSetting RUN C:\tools\scripts\Invoke-XdtTransform.ps1 -Path C:\inetpub\wwwroot -XdtPath C:\transforms\role -
In the
xdbsearchworkerfolder, in theDockerfilefile, enter the following instructions:RequestResponse# escape=` ARG BASE_IMAGE ARG SFCRM_IMAGE ARG TOOLING_IMAGE FROM ${SFCRM_IMAGE} as sfcrm 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=sfcrm \module\xdbsearchworker\content C:\service\ #Copy transformation files COPY --from=sfcrm \module\xdttransform\xdbsearchworker\transforms\ C:\transforms\role # Update value for IndexPIISensitive and IndexAnonymousContactData in IndexerSetting RUN C:\tools\scripts\Invoke-XdtTransform.ps1 -Path C:\service -XdtPath C:\transforms\role -
In the
compose\<version>\<topology>\docker-compose.override.ymlfile, add build instructions for each role. If you are using, for example, the XP0 topology, the file will look like this:RequestResponseservices: cm: image: sitecore-sfcrm-xp0-cm:${SITECORE_VERSION} build: context: ./module dockerfile: ./cm/Dockerfile args: BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-xp0-cm:${SITECORE_VERSION} DEF_IMAGE: ${SITECORE_DOCKER_REGISTRY}modules/sitecore-def-xp0-assets:${DEF_VERSION} SFCRM_IMAGE: ${SITECORE_DOCKER_REGISTRY}modules/sitecore-sfcrm-xp0-assets:${SFCRM_VERSION} TOOLING_IMAGE: ${SITECORE_TOOLS_REGISTRY}sitecore-docker-tools-assets:${TOOLS_VERSION} environment: Sitecore_ConnectionStrings_mysf: ${MYSF_CONNECTIONSTRING} xdbsearchworker: image: sitecore-sfcrm-xp0-xdbsearchworker:${SITECORE_VERSION} build: context: ./module dockerfile: ./xdbsearchworker/Dockerfile args: BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-xp0-xdbsearchworker:${SITECORE_VERSION} SFCRM_IMAGE: ${SITECORE_DOCKER_REGISTRY}modules/sitecore-sfcrm-xp0-assets:${SFCRM_VERSION} TOOLING_IMAGE: ${SITECORE_TOOLS_REGISTRY}sitecore-docker-tools-assets:${TOOLS_VERSION} xconnect: image: sitecore-sfcrm-xp0-xconnect:${SITECORE_VERSION} build: context: ./module dockerfile: ./xconnect/Dockerfile args: BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-xp0-xconnect:${SITECORE_VERSION} SFCRM_IMAGE: ${SITECORE_DOCKER_REGISTRY}modules/sitecore-sfcrm-xp0-assets:${SFCRM_VERSION} TOOLING_IMAGE: ${SITECORE_TOOLS_REGISTRY}sitecore-docker-tools-assets:${TOOLS_VERSION} -
In the
compose\<version>\<topology>\.envfile, add the asset image version. For example:RequestResponseDEF_VERSION=<image version for your topology> SFCRM_VERSION=<image version for your topology> SITECORE_TOOLS_REGISTRY=scr.sitecore.com/tools/ TOOLS_VERSION=<image version for your topology>NoteYou can find the image version in the Sitecore Docker Images repository.
-
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 SFCRM connector module to Sitecore in Docker.
If you are deploying to Kubernetes, continue with the instructions in Walkthrough: Adding the SFCRM connector module to Sitecore in Azure Kubernetes Service.