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:RequestResponse<CredentialsClient> *** <ClientSecrets> <TenantService>2ffe4e77325d9a7152f7086ea7aa5114</TenantService> </ClientSecrets> </CredentialsClient>
-
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.xml
config file.client ID
A unique client ID for the connection.
For example:
RequestResponse<add name="sitecore" connectionString="database=master; tenant id={2A593000-2FDA-1234-1234-092F0CA338BD}; host=https://my-sitecore-instance; timeout=20; auth endpoint=https://my-sitecore-identityserver/; client secret=2ffe4e77325d9a7152f7086ea7aa5114; client id=SitecoreCredentials" />
-
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:
RequestResponse<add name="sitecore" connectionString="database=master; tenant id={2A593000-2FDA-1234-1234-092F0CA338BD}; host=https://my-sitecore-instance; password=b; user name=sitecore\admin; timeout=20" />
-
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_Config
folder, open theConnectionString.config
file. -
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.config
file. -
In the
connectionStrings
node, add a connection string for the TS. For example:RequestResponse<add name="my-tenant" connectionString="https://my-sitecore.service"/>
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.