Configure Tenant Service connection strings
To use the Tenant Service (TS), you must configure a TS connection string. This enables you to read its configuration through the Web Item API. You can configure the connection string in two ways:
- With Identity Server authorization.
- With username and password authorization.
When you have configured the connection string using either of those two methods, you must add it to your TS configuration.
Use Identity Server authorization
To configure a connection string for Identity Server (IS) authorization:
-
On your IS instance, go to the installation folder, and open the IS config file, for example,
\sitecore\Sitecore.Plugin.IdentityServer\Config\identityServer.xml. -
Uncomment the
<CredentialsClient>node. Inside this node, locate the<ClientSecrets>node. Add a securely generated value that IS can use for TS authentication. For example: -
Save the file. Restart the Identity Server to force it to load the updated configuration.
-
Construct a connection string using the following properties:
Property Description name Must be sitecore. database The Sitecore database the connection goes to. tenant ID The ID for the tenant created in Data Exchange Framework. host The URL for your Sitecore instance. If you use a scaled Sitecore topology, use the URL for your content management server. auth endpoint The URL for your Sitecore Identity Server. client secret The secure value you entered in the identityServer.xmlconfig file.client ID A unique client ID for the connection. For example:
-
Follow the instructions in Add connection strings to the tenant web service.
Use username and password authorization
To configure a connection string for username and password authorization:
-
Construct a connection string using the following properties:
Property Description name Must be sitecore. database The Sitecore database the connection goes to. tenant ID The ID for the tenant created in Data Exchange Framework. host The URL for your Sitecore instance. user name A user name that has access to Sitecore. password The password for the user name. For example:
-
Follow the instructions in Add connection strings to the tenant web service.
Add connection strings to the tenant web service
To add the necessary connection strings to the tenant web service:
-
In the TS installation, in the
C:\inetpub\wwwroot\<service folder>\App_Configfolder, open theConnectionString.configfile. -
Locate the connection string named
sitecore. If it is not there, add the connection string you constructed. If it is there, replace it with the connection string you constructed. -
Save the file.
-
On the Sitecore servers that connect to the TS, open the server's
App_Config\ConnectionStrings.configfile. -
In the
connectionStringsnode, add a connection string for the TS. For example:
You can test the connection between the Sitecore server and the TS by requesting the http://<tenantservice>/api/tenant URL. The response displays the available TS endpoints.