Walkthrough: Adding the Tenant Service module to Sitecore in Docker
You can add Sitecore Data Exchange Framework (DEF) Tenant Service (TS) module in a container environment using Docker. This walkthrough describes how to:
-
Prepare the installation files.
-
Deploy the Tenant Service container.
-
Deploy a plugin to the Tenant Service container (optional).
Prepare the installation files
To prepare the files you need for the installation:
-
Download the DEF-TS container deployment package from the Sitecore download page. Extract it to your local workstation with the folder structure intact.
-
Go to the folder into which you extracted the DEF-TS container deployment package. Locate the folder for the Windows version and topology you are using, for example,
def-ts\compose\ltsc2019\xp1. -
Copy the
tenant-service.override.ymlfile to the Sitecore container deploymentcompose\<version>\<topology>folder (the same location as thedocker.compose.ymlfile). -
In the folder, open the
.env-examplefile in an editor. The following shows an example of the file's content:RequestResponse#The host for the Tenant Service website, for example, <topology-to-deploy>ts.localhost TENANT_SERVICE_HOST=<...> #The version tag for the Tenant service image MODULE_VERSION=<...> #The Tenant Id after it is created in Sitecore SITECORE_TENANT_ID=<...> #The Client Id of Sitecore Identity Server SITECORE_CLIENT_ID=<...> #The Client Secret of Sitecore Identity Server SITECORE_CLIENT_SECRET=<...> -
Copy all the variables in the file to the clipboard.
-
In the Sitecore container deployment folder on your local machine, open the
.envfile in an editor, and paste in the variables from the DEF-TS.env-examplefile. -
Save the
.envfile.
Deploy the Tenant Service container
When you have prepared the installation files, you must deploy the DEF TS container.
To deploy a TS container:
-
Add HTTPS/TLS certificates for the Tenant Service. For detailed instructions, see the Installation Guide for Developer Workstation with Containers available on the Sitecore Downloads site.
-
In the Windows console, go to the folder containing the
tenant-service.override.ymlfile. Run this command:RequestResponsedocker-compose -f docker-compose.yml -f docker-compose.override.yml -f tenant-service.override.yml up --detach -
To test if the Tenant Service is running, open a browser, and navigate to
https://<topology>ts.localhost. -
To update your search indexes, browse to your Sitecore URL, for example,
https://xp1cm.localhost/. Open the control panel, and click Populate Solr Managed Schema. After Sitecore has populated the Solr Schema, click Indexing Manager, select the index to rebuild, and then click Rebuild. -
In the Sitecore content management container, create a DEF tenant, and upgrade the tenant.
-
In the DEF tenant, create a DEF Tenant Service endpoint. Enable the DEF tenant and the DEF Tenant Service endpoint.
-
Copy the DEF tenant ID from the DEF tenant, and in the
.envfile, paste it in as the value for the SITECORE_TENANT_ID variable. -
Open a PowerShell window with administrator rights, and navigate to your local deployment folder.
-
To update all the containers, run the following command:
RequestResponseDocker-compose -f docker-compose.yml -f docker-compose.override.yml -f tenant-service.override.yml up –detach -
To test if the tenant is available, open a browser, and browse to
https://<topology>.localhost/api/tenant.
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 .
Deploy a plugin to the Tenant Service container
If you want to use TS in a connector module such as, for example, Sitecore Connect for Salesforce CRM, you must deploy a plugin for that connector.
To deploy a plugin to the TS container:
-
In the Window console, get the name of the TS container by running this command:
RequestResponsedocker-compose ps -
Stop the TS container by running this command:
RequestResponsedocker stop <container name> -
Add the plugin by running this command:
RequestResponsedocker cp <source path> <container name>:"c:/inetpub/wwwroot"NoteReplace
<source path>with the path to the folder containing the plugin. -
Start the TS container again by running this command:
RequestResponsedocker start <container name>