Install KanBo Search as a Web App on Azure

Installation steps 

Infrastructure

1. Create a WebApp on Azure.

Go to App Services, then select +Add and now select Web App.

2. Set the following for your application:

- add a name for your application, 

- select the subscription, 

- OS: Windows,

- Publish: Code,

- App service plan/location: select your app service plan.

Now click Create.

3. When the app is created, go to Advanced Settings of it.

Choose:

- Java 8 in Java version,
- 1.8.0_172 (or newer) in Java minor version,

- Newest Jetty 9.1 in Java Web container,

- 64-bit in Platform,

- On in Web Sockets,

- On in Always On,

- Integrated w Managed Pipeline version,

- 1.1 in HTTP version.

Save these settings.

4. Make sure to add the Java_Home value inside of Application settings. TIP: check your Java Home path in https:/{Your Solr Web App}.scm.azurewebsites.net/env

 Solr installation

1.Go to https://{Your Solr Web App Name}.scm.azurewebsites.net/DebugConsole/?shell=powershell -> site, create a new folder and upload Solr Installer.zip there (drag&drop it to the right side of your Kudu browser.

2. In the wwwroot directory, add the following web.config.Web.config

3. Go back to your Solr installer directory.

Start editing the file KanBoSolrSetup.ps1. Adjust all information written in italic.

$keytoolPath = "C:\Java\jdk1.8.0_161\jre\bin\keytool.exe" - here change the path to your Java folder. On Azure, you can check this path at https://kanbosolr.scm.azurewebsites.net/env . Example: D:\Program Files\Java\jdk1.8.0_172\bin\keytool.exe.

$solrPath = 'c:\kanbo-solr'  - locaction where you want to put KanBo Search component files. Example: D:\home\site\wwwroot\solr
$solrVersion = "7.5.0" ## '7.5.0'

$solrWwwLogin = 'admin- write there a login for the Search service
$solrWwwPassword = 'password'  - write there a password for the Search service

$solrCertificateCN = 'mysearch.local' # Ex. mysearch.local  - CN name of certificate in store
$solrKeyStorePassword = 'password' # Minimum 6 characters - certificate password
$valDays= 365 - days when your certificate will be valid

# Optional, $solrKeyStorePassword must be the same as the password for a pfx file that will be imported
$pfxPath = ""  - you can also specify a location for the certificate if you already have one and uploaded it to Kudu directory. Leave this value empty if you decide to generate a certificate using $solrCertificateCN.

Save the changes in the file. Don't run it for now.


4. Make sure to uncomment InstallAzure and comment back Install at the botom of the script.

#Install
Install-Azure

5. Start editing the file AddCore.ps1. Adjust all information written in italic.

Target solr path, must exist
$solrPath = 'c:\kanbo-solr' - your path to the Solr folder

# Values for the parameters below can be found in the web.config in the value of KanBoContentConnectionString
$serverName = '' #If there is a need to specify port please use the comma ex. serverName:1433

$database = 'KanBoContent...'  -The name of KanBo Content Database. You can find it in the value of the KanBoSqlConnectionString in web.config
$dbUser = 'username' - Add here a name of SQL database user.
$dbPass = 'password' - Add here a password for the user above


# arbitrary name that will be used in the KanBo config file
$solrCoreName = 'kanbocore' - add a custom name for the core

Save the changes in the file. Don't run it for now.

6. Run the script KanBoSolrSetup.ps1.

Wait until it's finished.

7. Run the script AddCore.ps1.

Wait until it's finished.

8. Go to site -> wwwroot folder and edit the web.config. Adjust the path to your freshly created solr folder -> bin -> solr.cmd.

   <httpplatform processpath="%HOME%\site\wwwroot\solr\bin\solr.cmd" arguments="start -f -p %HTTP_PLATFORM_PORT%" startuptimelimit="20" startupretrycount="10" stdoutlogenabled="true" stdoutlogfile="%HOME%\LogFiles\solr.log">

9.  Now you can run solr with kanbo core. Enter https://{YOUR APP NAME}.azurewebsites.net to access the admin panel and log in using your solr credentials.

10. Here you will see the admin panel of Solr.

11. .Enter the KanBo Core "KanBo" and run a data import to check the connection.

Create a crawl task

1. Download the Powershell script and .bat file from here: SolrCrawlJob.zip,

2. Start editing the Powershell (ps1) script. 

Fill in the data: 

- {CoreName} - name of KanBo Core,

- {SolrAdminName} - Solr user account name

- {SolrAdminPassword} - Solr user account's password 

- {AzureAddress/Solr} - your Solr app address, example https://mykanbosolr.azurewebsites.net/solr

Save the script.

$solr = Create-SolrContext -core "{CoreName}" -user "{SolrAdminName}" -pass "{SolrAdminPassword}" -url "{Azureaddress/solr}"

You can also adjust this line to configure timing for the full crawl to be performed. In such entry, full crawl will run between 8PM and 9 PM, but you can se it accordingly to your needs (it should be time when no one is using KanBo).

if( $now.Hour -ge 20 -and $now.Hour -le 21) {
    Write-Host "Full crawl";
} else {
    Write-Host "Differential crawl";
}

3. Make a .zip file out of saved PowerShell script and .bat file.



4. Go to your Azure Web App and enter Webjobs.

5.Click on +Add.

6.. Configure the new job:

- Name: select a name,

- File upload: upload a .zip with .ps1 and .bat files.

- Type: Triggered,

- Triggers: Scheduled,

- CRON Expression:  0 */15 * * * * (meaning: after 15 minutes, you can change it to different frequency as a CRON Expression).

Save thre webjob.

7. Now you can monitor the performance of your Webjob in the Webjobs section.

Adjust KanBo web.config


1.In case of Azure installation, go to https://{kanbo web app name}.scm.azurewebsites net/DebugConsole/?shell=powershell, enter Site and then wwwroot and enter web.config from here.

Start editing it.


2. Delete the following entry from the <plugins> section. 

     <package name="search-db"></package>

3. Add the following section to the <plugins> section of web.config and just the following: your solr address, port, core's name, Solr administrator name and password. 

example:

<plugin alias="plugin-config-executor.multiplex-config" user="{SolrAdmin}" pass="{SolrAdminPassword}" allow-all-certificates="true" url="https://{YourServer}:{port}/solr/{CoreName}">
     <plugin alias="search-docs.solr" />
        <plugin alias="search-cards.solr" />
        <plugin alias="search-boards.solr" />
            <plugin alias="search-users.solr" />
      
      </plugin> 

Save these changes.

4. Make sure that httpruntime targetfrwamework="4.6"

   <system.web>
    <compilation targetframework="4.7" />
    <httpruntime targetframework="4.6" maxrequestlength="25165824" />
    <customerrors mode="Off" />
    <identity impersonate="false" />
 </system.web>

5. Go back to the wwwroot folder and check if the Extensions folder has all plugins needed for KanBo Search .

 Go to Kanbo.log to see if SOLR plugin is working properly.

2018-02-07 02:06:36,480 Plugins         DEBUG | plugin 20000000-0000-0000-0000-000000000001(Solr Cards Search): Ok! 
2018-02-07 02:06:36,480 Plugins         DEBUG | plugin 20000000-0000-0000-0000-000000000002(Solr Documents Search): Ok! 
2018-02-07 02:06:36,480 Plugins         DEBUG | plugin 20000000-0000-0000-0000-000000000003(Solr Boards Search): Ok!
2018-02-07 02:06:36,480 Plugins         DEBUG | plugin 20000000-0000-0000-0000-000000000003(Solr Users Search): Ok!

6. As for the last step, you can check if the search works properly in your KanBo. Try to search for a common card and document name in your KanBo.

Try to find a user by his name in KanBo Search.

Go to Discover Boards section and look for a Board.

This article was helpful for 1 person. Is this article helpful for you?