Multitenant mode
In multitenant mode, one installation of Alvao Server serves several customers (tenants).
Creating a tenant database
Using DatabaseDeploy
Create a tenant database on SQL Server by running DatabaseDeploy with parameter /multitenant.
Setting multitenant mode
Alvao Service
- Edit the appsettings.json file, e.g. using Notepad.
- Find the ConnectionString section.
- In this section, replace the existing connection with the new one. Replace it with a connection named AlvaoTenants that contains a connection string to the tenants database.
Example:
"AlvaoTenants": "Data Source=localhost;Initial Catalog=AlvaoTenants; Max Pool Size=2000; Integrated Security=True; MultipleActiveResultSets=True"
On SQL Server, set the necessary permissions for Alvao Service. The settings for the tenant database are the same as for the database in single tenant mode. The recommended user roles are db_datareader, db_datawriter, db_ddladmin, db_owner and db_executor.
Alvao RestApi
- Edit the appsettings.json file, e.g. using Notepad.
- Find the ConnectionString section.
- In this section, replace the existing connection with the new one. Replace it with a connection named AlvaoTenants that contains a connection string to the tenants database.
Example:
"AlvaoTenants": "Data Source=localhost;Initial Catalog=AlvaoTenants; Max Pool Size=2000; Integrated Security=True; MultipleActiveResultSets=True"
WebApp
- Edit the appsettings.json file, e.g. using Notepad.
- Find the ConnectionString section.
- In this section, replace the existing connection with the new one. Replace it with a connection named AlvaoTenants that contains a connection string to the tenants database.
Example.:
"AlvaoTenants": "Data Source=localhost;Initial Catalog=AlvaoTenants; Max Pool Size=2000; Integrated Security=True; MultipleActiveResultSets=True"
Custom Apps WebService
This component is installed only for tenants who have purchased the ALVAO Asset Management Custom Apps or ALVAO Service Desk Custom Apps module.
For multitenant mode, first prepare a ZIP package to install service instances for each tenant:
-
Install the MSI package AlvaoCustomAppsWebService.msi using the "admin" installation: msiexec /a AlvaoCustomAppsWebService.msi
noteRun the command line "as administrator".
-
- "Zip" the folder from IIS where the application was installed (e.g. C:\inetpub\wwwroot\AlvaoCustomAppsWebService) and create a single ZIP archive, e.g. CustomAppsWebService.zip
Adding a new tenant
-
For a new customer, register a new (sub)domain in DNS (e.g. zakaznik1.alvao.com) that points to the IP address of the server with the Alvao web applications installed.
-
On SQL Server, use the DatabaseDeploy utility to create a DatabaseDeploy for customer . new database in the appropriate language (according to the customer's requirement). Activate the database.
note- The name of the database is recorded as case sensitive text, so be sure to observe case when transcribing.
- When a new database is created, a strong authentication code is automatically generated for AM Agents. The code can be changed in Administration - Asset Management - Settings - Scan - Agent authentication code field.
noteOn SQL Server, set the necessary permissions for IIS processes. The settings for the tenant database are the same as for the database in single tenant mode. The recommended user roles are db_datareader, db_datawriter, db_ddladmin, db_owner and db_executor.
-
Go to the AlvaoTenants database, e.g. using SQL Server Management Studio, edit the Tenant table and insert the corresponding values into it.
Ex:
- Organization = Customer 1
- Domain = zakaznik1.alvao.com
- ConnectionString = Data Source=server1;Initial Catalog=Zakaznik1; Max Pool Size=2000; Integrated Security=True;TrustServerCertificate=True
Since Alvao 11.2 SP1 you can add a new tenant to AlvaoTenants (step 3) and then use DatabaseDeploy with multitenant parameter to create a new database (instead of step 2).
Alvao Provider
One of the tenants can be designated as an Alvao provider. The provider has the right to create News for other tenants as well. To designate a provider, set the IsProvider column in its row in the tenant database to 1.
Custom Apps WebService
- On IIS, create a new folder named AlvaoCustomAppsWebService_<tenant name without hooks, commas, spaces and other special characters>, e.g.: C:\inetpub\wwwroot\AlvaoCustomAppsWebService_Zakaznik1 2. Extract the ZIP package CustomAppsWebService.zip (see Multitenant Mode Settings) into this folder.
- Edit the appsettings.json file, e.g. using Notepad. Find the section connectionStrings and set the connection string to the tenant database.
- Create an application pool specifically for this tenant's Custom Apps WebService with the same settings, as the other Alvao apps. Leave the pool identity at ApplicationPoolIdentity.
- On SQL Server, set the IIS APPPOOL account with db_datareader, db_datawriter, and db_executor permissions for the tenant database only.
- In the IIS Manager, select the newly created folder and select Convert to Application from the context menu. Select the application pool created in the previous steps and confirm the dialog by pressing OK.
- Enter the correct service address in the following SQL script and run the script on the new tenant's database:
exec spUpdateInsertProperty 'CustomAppsWebService.Url', 'https://<server>/CustomAppsWebService_Customer1'
Tenant upgrade
All tenants on a particular server must be upgraded at the same time because they share common server applications. If you need to upgrade only some tenants, you must first move them to another server.
Database upgrade
If you need to upgrade the database (installing SP1 or a new "big" version), use the DatabaseDeploy utility to upgrade all tenants' databases to the new version.
Alvao RestApi
- Install a new version of Alvao RestApi.
Alvao RestApi is common for all tenants on a given server.
Alvao Service
- Install a new version of Alvao Service.
Alvao Service is common for all tenants on a given server.
Alvao RestApi
- Install a new version of Alvao RestApi.
Alvao RestApi is common for all tenants on a given server.
WebApp
- Install a new version of WebApp.
WebApp is common for all tenants on a given server.
Custom Apps WebService
- Re-create the ZIP package for the current version of Alvao, see above.
- Extract the prepared ZIP package without the appsettings.json file into the tenants folders one by one, so that the instance settings are not overwritten.
Removing a tenant
- Go to the AlvaoTenants tenant database and edit the Tenant table, find the correct tenant and delete the entire row.
- On the SQL server, delete the Alvao database for the tenant.
Custom Apps WebService
- In the IIS Manager, delete the tenant application using the Remove command in the local menu.
- Remove the application pool for the Custom Apps WebService of this tenant.
- In the C:\inetpub\wwwroot folder, delete the instance folder for this tenant.