Setting up BIM Sync as a Webjob

Table of Contents

KanBo and BIM Sync Webjob configuration files

KanBo

First, a section of the KanBo appsettings.json has to be modified:

{
        "type": "job.bim-sync",
        "name": "bim-sync",
        "repeat": "1h",
        "client-id": "",
		"client-secret": "",
		"hostApi": true,
		"hostJob": false
      },

The bold section of the code is the new part of the BIM config in KanBo. It tells KanBo that it’s a host for the API, but not the entity that syncs the KanBo Spaces with BIM360 issues.

After that is done, save the appsettings.json and restart the KanBo app for the changes to take place.

Bim Sync job

Now, we will need to create a webjob package for the BIM Sync job. It’s recommended to download the Profile Sync webjob and modify the appsettings.json present there, as it already has most of the configuration done (database connection string, AAD authentication section). If You do so, please make sure to remove the settings.job file that contains the Profile Sync’s CRON.

As for the configuration, there are two things that need modifying. First, the loading of BIM Sync DLL:

"KanBo": {
  "config": {},
  "assemblies": [
  {"Path": "PATH/KanBo.BimPlugin.dll"}
  ],

Normally, the assemblies variable is an empty array, but in this case, we need to add a path to KanBo.BimPlugin.dll. You can find this DLL in the plugins folder of Your KanBo App (example of a path in an Azure App Service would be C:/home/site/wwwroot/plugins/KanBo.BimPlugin.dll).

If You are hosting the Sync Job on a separate App Service or server, please copy the whole plugin folder of KanBo and add it to the job folder, then point to it in the path (using a full path).

Next, the plugins section:

"plugins": [
   "load-packages",
   {
    "type": "package",
    "name": "auth-aad",
    "client-id": "CLIENT-ID",
    "tenant": "TENANT",
    "thumbprint": "THUMBPRINT"
   },
   {
        "type": "job.bim-sync",
        "name": "bim-sync",
        "repeat": "1h",
        "client-id": "BIM-CLIENT-ID",
		"client-secret": "BIM-CLIENT-SECRET",
		"hostApi": false,
		"hostJob": true
      },
	  {
      "type": "kanbo-api.service",
      "issuer": "kanbo-webjob",
      "url": "https://KANBO-URL",
      "signer": {
        "type": "x509-store",
        "store-name": "my",
        "store-location": "currentuser",
        "key": "thumbprint",
        "value": "THUMBPRINT",
        "valid-only": false
      }
	  }
  ]

The bolded section shows the new code of the appsettings.json, the authentication part (line 3 to 9) should be the same as it was. As for the BIM Sync section, You should use the same values that are used in Your KanBo app.

After configuring the appsettings.json, save it, zip all the contents of the folder and create a scheduled Webjob using it.