Walkthrough: Adding the Tenant Service module to Sitecore in Docker

Abstract

Guide to adding the Sitecore Data Exchange Framework Tenant Service module to a container environment using 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).

To prepare the files you need for the installation:

  1. Download the DEF-TS container deployment package from the Sitecore download page. Extract it to your local workstation with the folder structure intact.

  2. 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.

  3. Copy the tenant-service.override.yml file to the Sitecore container deployment compose\<version>\<topology> folder (the same location as the docker.compose.yml file).

  4. In the folder, open the .env-example file in an editor. The following shows an example of the file's content:

    #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=<...>
  5. Copy all the variables in the file to the clipboard.

  6. In the Sitecore container deployment folder on your local machine, open the .env file in an editor, and paste in the variables from the DEF-TS .env-example file.

  7. Save the .env file.

When you have prepared the installation files, you must deploy the DEF TS container.

To deploy a TS container:

  1. 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.

  2. In the Windows console, go to the folder containing the tenant-service.override.yml file. Run this command:

    docker-compose -f docker-compose.yml -f docker-compose.override.yml -f tenant-service.override.yml up --detach
  3. To test if the Tenant Service is running, open a browser, and navigate to https://<topology>ts.localhost.

  4. 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.

  5. In the Sitecore content management container, create a DEF tenant, and upgrade the tenant.

  6. In the DEF tenant, create a DEF Tenant Service endpoint. Enable the DEF tenant and the DEF Tenant Service endpoint.

  7. Copy the DEF tenant ID from the DEF tenant, and in the .env file, paste it in as the value for the SITECORE_TENANT_ID variable.

  8. Open a PowerShell window with administrator rights, and navigate to your local deployment folder.

  9. To update all the containers, run the following command:

    Docker-compose -f docker-compose.yml -f docker-compose.override.yml -f tenant-service.override.yml up –detach
  10. To test if the tenant is available, open a browser, and browse to https://<topology>.localhost/api/tenant.

Note

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 .

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:

  1. In the Window console, get the name of the TS container by running this command:

    docker-compose ps
  2. Stop the TS container by running this command:

    docker stop <container name>
  3. Add the plugin by running this command:

    docker cp <source path> <container name>:"c:/inetpub/wwwroot"

    Note

    Replace <source path> with the path to the folder containing the plugin.

  4. Start the TS container again by running this command:

    docker start <container name>