Check Database Connection and Framework Folder Configuration
This article describes the configuration of the database connection settings (= database connection strings) and the
FrameworkBCFolder
configuration.
All settings can be found by opening the appsettings.json in the %OMETA_INSTALL_ROOT%\Ometa Software Suite map.
Warning
The appsettings.json file adheres to the JSON structure format. Any special characters in file paths and connection strings must be escaped. The most common use case for escaping characters are backslashes between folder names.
For example: you would write C:\Program Files (x86)\Ometa BVBA
but in the JSON format, the backslashes must be escaped: C:\\Program Files (x86)\\Ometa BVBA
.
Framework BC Folder Configuration
The Core Web Service and framework OPC UA Windows service provide access OPC UA servers. But to provide that access, both services need to know the connection information defined in the framework profiles to be able to set up connections to those OPC UA servers.
The location to the profiles is defined the FrameworkBCFolder setting which must contain the correct path to the BC folder of the framework install.
appsettings.json example:
{
// ...
// Other JSON Settings
// ...
"FrameworkBCFolder": "C:\\Program Files (x86)\\Ometa BVBA\\Ometa Software Suite\\TopDir\\BC",
// ...
// Other JSON Settings
// ...
}
Database Connection Strings
Note
When installing framework v5.0, the information below may be skipped as the connection strings are automatically configured by the installer. However, for older versions or when upgrading from an older version, it may still be required to fill or adapt the database connection settings.
Additionally, it is certainly a good idea to check the values of the connection strings to make sure they are correct.
Check and update if needed the connection strings to the Ometa Framework and Ometa Dynamic Case System databases:
- OmetaFrameworkDatabase: must point to the Ometa Framework database.
- OmetaBAMDatabase must point to the the Ometa BAM database.
Make sure that the database name in the connection string is the same as the database name from the SQL server, and ensure that the user account in the connection string has enough access rights to completely manage the database.
Note
Older versions may have an additional connection string for a separate dcs database. This was changed in v5.3.0, but does not require a change in the appsettings.json file. Refer to the 5.3.0 release notes for more information.
SQL Server On Premise
The settings shown provides two examples for the data source. The first 3 examples are using trusted connections where the account of the application pool must have permissions on the database. Ometa recommends to use trusted connections. The second one uses an user account and password are listed in the appsettings.json file itself.
Setting the trusted_connection property to yes will result in the fact that the user account of the IIS application pool is used for database actions.
General appsettings.json:
{
// ...
// Other JSON Settings
// ...
"ConnectionStrings": {
"OmetaFrameworkDatabase": "Data Source=dbserver.ometa.net;database=framework database;trusted_connection=yes;TrustServerCertificate=True;",
"OmetaBamDatabase": "Data Source=sqlserver.domain.net;database=OmetaBAMDatabase;trusted_connection=yes;TrustServerCertificate=True;"
}
}
In case a connection string with the name BAMConnection is still present, that line can be removed as it will be ignored.
Azure SQL Database
When using Azure SQL Database services for data storage, adapt the connection strings a bit:
{
// ...
// Other JSON Settings
// ...
"ConnectionStrings": {
"OmetaFrameworkDatabase": "Data Source='tcp:your-azure-instance-sql.database.windows.net,1433';database=dcs database;Uid=sqlaccount;Pwd=sqlpwd;Encrypt=yes;TrustServerCertificate=no;Connection Timeout=30;",
"OmetaBamDatabase": "Data Source='tcp:your-azure-instance-sql.database.windows.net,1433';database=OmetaBAMDatabase;Uid=sqlaccount;Pwd=sqlpwd;Encrypt=yes;TrustServerCertificate=no;Connection Timeout=30;"
}
}
Replace your-azure-instance-sql.database.windows.net, sqlaccount and sqlpwd with the proper corresponding values.
BAM Portal
The BAM portal uses the OmetaFrameworkDatabase
and OmetaBamDatabase
by default. In case of compatibility issues, the BAM portal can use a different connection string to display the case data by specifying CASEDBEntities
in the format below.
In this case, this connection string will overrule the OmetaFrameworkDatabase
only for the BAM portal.
"ConnectionStrings": {
"OmetaFrameworkDatabase": "Data Source=dbserver.ometa.net;database=framework database;trusted_connection=yes;TrustServerCertificate=True;",
"OmetaBamDatabase": "Data Source=sqlserver.domain.net;database=OmetaBAMDatabase;trusted_connection=yes;TrustServerCertificate=True;",}
"CASEDBEntities": "metadata=res://*/CaseDBModel.csdl|res://*/CaseDBModel.ssdl|res://*/CaseDBModel.msl;provider=System.Data.SqlClient;provider connection string="data source=dbserver.ometa.net;initial catalog=framework database;persist security info=True;trusted_connection=yes;MultipleActiveResultSets=True;App=EntityFramework""
},
Important
Do not replace the entire connection string in CASEDBEntities; only the values of the settings data source, initial catalog, and if needed as well the user id and password.
The difference in connection strings is due to the use of different database libraries connecting to the databases.