5 Set Up Replication

Now that you have set up your LS Central Scheduler instance and downloaded the Analytics product package, you need to set LS Central up to control the replication. The web service setup points to the web service you just set up in your LS Central in-cloud, but the jobs and distribution locations will be set up in this on-premises instance of LS Central.

Note: If you have set up web service for more than one company in LS Central SaaS, you must also have more than one company on the Scheduler server. You can just copy the company that exists in LS Central. The names of the companies on the Scheduler server do not matter, but it is good practice to make them the same as in LS Central SaaS.

Web service setup on Scheduler

Once you have set up the LS Central instance on-premises on the same machine where the Data Director is running, you need to set up the web service to match the LS Central SaaS web service you sat up previously, but since you are connecting to the web service you just sat up in SaaS, no S2S_User needs to be set up in the on-premises LS Central instance.

As with the SaaS setup, follow these steps and duplicate the setup you did in your LS Central SaaS:

  1. Navigate to the Web Service Setup page in LS Central.
  2. In the General FastTab:
    • Enable the Web Service is Active switch.
  3. In the Server FastTab, fill in these fields:
    • Enable the SSL switch.
    • Enable the SaaS switch.
    • Server Computer Name: lscentral.api.bc.dynamics.com or, if your environment is on the MS cluster, it should be api.businesscentral.dynamics.com. The difference in the server computer name will also be reflected in the web service and base url below.
    • Version: v2.0
    • Company Name: Name of the company you are replicating from in LS Central SaaS. This should be the company you see, if you click the cogwheel icon and go to My Settings. Example: My Company
    • Tenant: Your tenant ID. This is visible in the address bar of your browser and was also visible in the App registration overview.
      Example: 696b709f-51ad-407e-83cd-e76c6e84843b
    • Web Service URI: Generated automatically by the system from the parameters you have inserted.
      Example: https://lscentral.api.bc.dynamics.com/v2.0/696b709f-51ad-407e-83cd-e76c6e84843b/Production/WS/My%20Company/Codeunit/RetailWebServices?Tenant=696b709f-51ad-407e-83cd-e76c6e84843b
    • Base URL: Generated automatically by the system from the parameters you have inserted.
      Example: https://lscentral.api.bc.dynamics.com/v2.0/696b709f-51ad-407e-83cd-e76c6e84843b/Production/WS/My%20Company?Tenant=696b709f-51ad-407e-83cd-e76c6e84843b
    • Environment: This is the name of your LS Central SaaS environment.
      Example: Production.
  4. In the Logs FastTab you can turn on logging for the web service, if you want to. This can help you troubleshoot any errors that may occur in the web services.

  5. In the Client Credentials FastTab fill in these fields: 
    • Enable the Override Client Credentials switch.
    • Http Authentication type: S2S.
    • Client ID: The application (Client) ID that you saved earlier.
      Example: 3bc124d5-98f2-4437-8834-2d9172e4b802
    • Client Secret: Value from the Client secret that you created and saved in the App registration.
      Example: C_Y8Q~a9vUuKcrcQh9Zui3jdCUO_MacFMP_JOb12
    • Navigate to a different field to save your changes.


Publish and subscribe to Web services

  1. Navigate to the Web Requests 2.0 page in LS Central.
  2. Check that the Base URL matches the one you set up in the Web Service Setup (here the URL ends with the Company name). 
  3. Click the Publisher action. This will publish all web services.
  4. Click the Subscriber action. This will subscribe to all web services. 
  5. You can now test the connection you just created by clicking Actions in the top menu and selecting Function - Test Web Connection.
    • This should result in a message stating that the connection was tested successfully in an X number of seconds.
    • If test connection fails, you need to review the parameters in the fields above.

Distribution location setup

Next, you must set up the distribution locations for LS Central SaaS and Analytics in Azure.

LS Central SaaS distribution location

  1. Navigate to the Distribution Location List in LS Central on the Scheduler server.
  2. Click the New action to create a new distribution location .
  3. In the General FastTab, enter these values:
    • Code: LSCCLOUD
      A confirmation message appears, click Yes.
    • Description: LS Central SaaS.

    Leave other fields blank or unchanged.

  4. In the Data Director FastTab, enter these values:
    • Data Director mode: TCP
    • Distribution Server: Computer name of the machine where Data Director is running.
      Example: DHOSRVIN03

      Tip: You can find this name by pressing the Windows key + Pause/Break on this machine, or by opening the Configuration tool. The name is the Host name displayed to the left.

    Leave other fields blank or unchanged.

  5. In the WS Distribution Server FastTab:
    • Distribution Server URL: http://<DistributionServer>/DDWebservice
    • Distribution Server Auth Type: Select None

    Leave other fields blank or unchanged.

  6. In the Replication FastTab:
    • Data DirectorConnection Type: Use Web Server Connection.
    Web Server section
    • Company name: Is populated from Web Server fast tab setup below.
      Example: My Company
    • Tenant: Is populated from the Web Server FastTab.
      Example: 3bc124d5-98f2-4437-8834-2d9172e4b802
    • Replication URI: Is populated from the Web Server FastTab.
      Example: https://lscentral.api.bc.dynamics.com/v2.0/696b709f-51ad-407e-83cd-e76c6e84843b/Production/WS/My%20Company/Codeunit/RetailWebServices
    • Version: LSWS-S2S

      If this version does not exist in the list, you must create it:

      1. Click the icon, enter Dist. Location Versions, and select the relevant link.
      2. Click the New action, and enter the following information in the fields:
        • ID: LSWS-S2S
        • Description: LS Central SaaS oAuth
        • Plugin ID: lsws
        • Plugin String: s2s
    • Enable the Active for Replication switch.

    Manually entered Connection String section

    • Part 1: Leave blank
    • Part 2: Leave blank


  7. The Connection string is displayed in the Calculated Connection String FastTab.
  8. In the Web Server FastTab, enter these values:
    • Enable the Web SSL switch.
    • Enable the Web Server SaaS switch.
    • Web Server Computer Name: lscentral.api.bc.dynamics.com or if your environment is on the MS cluster it should be api.businesscentral.dynamics.com. The difference in the server computer name will also be reflected in the web service URI below.
    • Web Server Version: v2.0
    • Web Server Tenant: Tenant ID
    • Example: 696b709f-51ad-407e-83cd-e76c6e84843b
    • Web Server Environment Name: The name of the LS Central SaaS environment.
      Example: Production
    • Web Service Company Name: Company name
      Example: My Company
    • Web service URI: Automatically constructed from the fields you just entered.
      Example: https://lscentral.api.bc.dynamics.com/v2.0/696b709f-51ad-407e-83cd-e76c6e55543b/Production/WS/My%20Company/Codeunit/RetailWebServices
    • Enable the Web Override Credentials switch.
    • Web Server AuthType: S2S
    • Web Service Client ID: Application (Client) ID
      Example: 3bc124d5-98f2-4437-8834-2d9172e4b802
    • Web Service Client Secret: Client secret value
      Example: C_Y8Q~a9vUuKcrcQh9Zui3jdCUO_MacFMP_JOb23
  9. Click the Test Connection action:
    1. A message box asks if you want to test the connection, click Yes.
    2. If the connection is successful, a message box is displayed with the time it took to test and you can continue to the next step and move on to step 10.
    3. If the connection is not successful, an error is displayed and you need to check the parameters you used against the App registration.
  10. Click the Test Web Connection action:
    1. A message box asks if you want to test connection, click Yes.
    2. If the connection is successful, a message box is displayed with the time it took to test.
    3. If the connection is not successful, an error is displayed.

Both connections should test successfully before you continue. The connection tested by Test Connection is the connection used by the Data Director to get the data from SaaS, and Test Web Connection is used by the Scheduler to get actions and replication counters. If you get errors, it is most likely because the connection string is not correctly assembled, so check that your string has the correct Company, TenantID, Application(Client)ID and ClientSecret, and that you have entered the correct information in the Web Server FastTab. The error message should also give an indication of what is wrong.

Analytics in Azure distribution location

At this time you can only create this location and use it in your job setup, but you cannot complete it until Analytics has been set up in Azure.

  1. Navigate to the Distribution Location List in LS Central on the Scheduler server.
  2. Click the New action to create a new distribution location.
  3. In the General FastTab, enter these values:
    • Code: LSINSIGHT
      A message appears, click Yes.
    • Description:LS Insight in Azure

    Leave other fields blank or unchanged.

  4. In the Data Director FastTab, enter these values:
    • Data Director Mode: TCP
    • Distribution Server: The computer name of the machine where Data Director is running.
      Example: ISHQPF3M6CVR

    Leave other fields blank or unchanged.

  5. Tip: You can find this name by pressing the Windows key + Pause/Break on this machine, or by opening the Configuration tool. The name is the Host name displayed to the left.

  6. In the WS Distribution Server FastTab, enter these values:
    • Distribution Server URL: http://<DistributionServer>/DDWebservice
    • Distribution Server AuthType: None

    Leave other fields blank or unchanged.

  7. You will fill out the Replication FastTab later.
  8. No changes in the Web Server FastTab.
  9. You will not be able to test connections at this point since the Replication information has not yet been filled out. This will be discussed later in the process.

Scheduler job setup

You are now ready to set up the Scheduler jobs.

Import Scheduler jobs

In the product package that you downloaded, you will find the Scheduler Job Header.xml file. This file includes all the Scheduler jobs needed to move data from LS Central SaaS to Analytics data warehouse in Azure. The first thing you need to do is to import its content to your LS Central on the Scheduler server:

  1. Navigate to the LS Import Export WS page in LS Central on the Scheduler server.
  2. Select the Scheduler Job Header line from the list.
  3. Click the Process action, and then click Import.
    1. Browse to the file in the Base folder, and click OK.
    2. When asked, if you want to overwrite existing records, select No (you are not reusing any existing jobs).
    3. When the Import/Export data utility - confirm window is displayed, click OK.
  4.  The import will now run, and when it is finished it should display Import Finished 94 records in 8 tables. Click OK.
  5. Navigate back to the Scheduler Job List, and confirm that the INS jobs have been imported. There should be four new jobs:
    • LS Insight Action Preload (INS_ACTIONPRELOAD)
    • LS Insight Action jobs (INS_ACTIONS)
    • LS Insight Normal with counter (INS_NORMAL_COUNT)
    • LS Insight Normal Full Load (INS_NORMAL_FULL)

    All jobs should have the distribution locations already set to the locations you created earlier:

    • From-Location code: LSCCLOUD
    • To-Location code: LSINSIGHT

If you are using the LS Central for hotels extension, you need to repeat the above steps for the Scheduler Job Header_Hotels.json file to import the Hotel jobs for LS Insight.

The file includes one job for the Hotel tables:

  • LS Insight Hotel extension (INS_NORMAL_HOTEL)

You will need to add the distribution locations that you created earlier to this job:

  • From-Location code: LSCCLOUD
  • To-Location code: LSINSIGHT

Add receiver group to jobs

Open each of the new jobs, and follow these steps to check if the job has a Receiver group and add one if it is missing.

  1. Click the Related action, and then click Job - Receiver Groups.
  2. If there is no store group visible in the list, add the ALL group and navigate away from the field to save.
  3. Close the Job Receiver Groups page.

Note: Remember to repeat this for all four imported jobs.

This is all the setup you will do for now. Once you have set up Analytics, you will come back to LS Central on the Scheduler server to schedule and run the jobs.

 

< BackNext >