Skip to main content

Configuring access to the SQL server for tenant services

Before you install tenant services, you must configure access to the Incentives database.

  1. Extract the compressed files from the tenant services folder.

    Tip

    Move the extracted file to the same place as the REST API files. This makes it easier to find during the installation process, and later when you upgrade your models.

  2. From the config folder, open the defaults.json file.

  3. In the modelServer section, edit these parameters to configure access to your database:

    name

    This can be any name, like Super Server, and identifies the database server.

    instanceName

    The name of the instance of SQL Server installed. By default it is MSSQLSERVER. You can find what yours is by connecting to the server in SQL Server Management Studio. The instance name appears in parentheses in the Object explorer.

    Important

    Check the TenantServices\config\defaults.json file to make sure that there isn't a port listed in the instanceName string.

    address

    This address points to the location of the database. The format should be: SERVER_NAME\\INSTANCE_NAME where server_name is the host name or IP address for the server.

    If SQL Server is not using the default port 1433, you must add the port number to the server address field: SERVER_NAME\\INSTANCE_NAME, PORT_NUMBER.

    Important

    Make sure you use double backslashes in the address.

    hostname

    This is the host name or IP of the machine where SQL server is installed.

    user

    This is the Microsoft SQL Server user and requires SQL Server Authentication.

    password

    This is the password of the associated Microsoft SQL Server user.

    databaseType

    Match this with “Type” in defaults.json in the Tenant Services configuration. This is the type of database that you are using. Versions up to SQL 2016 are supported.

    If you are using SQL Server 2016, all configurations must set up as if you were SQL Server 2014. For example, if the database you are using is SQL Server 2016, then type sqlserver2014 or sqlserver2014unicode.

    timeoutSeconds

    This is the number of seconds before a timeout occurs. Increase this time to avoid timeouts during long calculations.

    logPath

    This is the location where the log file is created and stored.

    diskPath

    This is the location where the database is created and stored.

    Here's an example of what this looks like when all parameters are filled in:

    "modelServer": {
    
         "servers": [
    
             {
    
                 "id": 1,
    
                 "name": "default",
    
                 "datacenter": "default",
        
                 "instanceName": "SQL2014",
    
                 "address": "VaricentApplicationServer\\SQL2014",
    
                 "hostname": "VaricentApplicationServer",
    
                 "user": "sa",
    
                 "password": "aStr0ngP@ssw0rd",
    
                 "databaseType": "SQLServer2014Unicode",
    
                 "enableCreation": true,
    
                 "timeoutSeconds": "90000",
    
                 "logPath": "D:\\",
    
                 "diskPath": "D:\\",
    
                 "accessVersions": [1],
    
                 "logins": {
    
                     "1": {
    
                         "user": "sa",
    
                         "password": "Password*123"
    
                     }
    
                 }
    
             }
    
         ]
    
     },
  4. In the dbServices section, set “isRunning” to false. This section should look something like this when you're done:

    "DBServices": {
        "host": "localhost",
        "port": 9200,
        "protocol": "http",
        "isRunning": false
    },
  5. In the Database section, update these parameters:

    password

    Set this to the password created during the installation of PostgreSQL.

    port

    Set this to the port specified during the installation of PostgreSQL.

    ssl

    Set this to false.

    Important

    Make sure the port number matches what is written in the RestAPI.appSettings. By default it is 8080.

    Here's an example of what this looks like when all parameters are filled in:

    "database": {
        "user": "postgres",
        "password": "aStr0ngP@ssw0rd",
        "host": "localhost",
        "database": "tenants",
        "port": 5432,
        "ssl": false
    },

(Optional) Configuring password settings for tenant services

By default, passwords expire after 90 days and password history is maintained for five password changes. You can change these settings in the default.json file.

  1. Open the default.json file.

  2. Navigate to this section:

    "adminPasswordConfig": { 
       "password_expiration_enabled": true, 
       "password_expiration_period": 90, 
       "password_history_limit_enabled": true, 
       "password_history_limit": 5 
    }
  3. You can configure these values:

    Value

    Description

    password_expiration_enabled

    Change the value to false to prevent passwords from expiring for tenant services.

    password_expiration_period

    Set this value to the number of days that users have before they must change their password.

    password_history_limit_enabled

    Change the value to false to allow users to use the same password consecutively.

    password_history_limit

    Set this value to the number of times that users must create new passwords before they can reuse a previous password.

  4. Save the file.