Unable to get JSReports 3.7.1-full docker to connect to Azure SQL
-
I've been trying to get a docker version of 3.7.1-full to start up on Azure App Service and the connection setup to the Azure SQL Database is throwing a strange error saying that the encrypt setting must be a boolean.
Error occurred during reporter init: Error: Error when loading extension mssql-store@3.0.0 2022-08-09T19:41:59.512425047Z TypeError: The "config.options.encrypt" property must be of type boolean. 2022-08-09T19:41:59.512431347Z at new Connection (/app/node_modules/tedious/lib/connection.js:791:17) 2022-08-09T19:41:59.512436647Z at /app/node_modules/mssql/lib/tedious/connection-pool.js:64:19 2022-08-09T19:41:59.512440947Z at new Promise (<anonymous>) 2022-08-09T19:41:59.512445447Z at ConnectionPool._poolCreate (/app/node_modules/mssql/lib/tedious/connection-pool.js:12:12) 2022-08-09T19:41:59.512450047Z at ConnectionPool._connect (/app/node_modules/mssql/lib/base/connection-pool.js:364:10) 2022-08-09T19:41:59.512454247Z at /app/node_modules/mssql/lib/base/connection-pool.js:336:19 2022-08-09T19:41:59.512458447Z at new Promise (<anonymous>) 2022-08-09T19:41:59.512462547Z at ConnectionPool.connect (/app/node_modules/mssql/lib/base/connection-pool.js:335:12) 2022-08-09T19:41:59.512466747Z at Object.connect (/app/node_modules/mssql/lib/global-connection.js:59:27) 2022-08-09T19:41:59.512470847Z at Object.module.exports (/app/node_modules/@jsreport/jsreport-mssql-store/lib/main.js:11:26) 2022-08-09T19:41:59.512475047Z at Object._useOne (/app/node_modules/@jsreport/jsreport-core/lib/main/extensions/extensionsManager.js:248:15) 2022-08-09T19:41:59.512480147Z at async Object._useMany (/app/node_modules/@jsreport/jsreport-core/lib/main/extensions/extensionsManager.js:99:27) 2022-08-09T19:41:59.512484348Z at async MainReporter.init (/app/node_modules/@jsreport/jsreport-core/lib/main/reporter.js:216:7)
The application settings in the Azure App Service mssql-store options are setup as:
extensions_mssqlStore_options_encrypt: true extensions_mssqlStore_options_trustServerCertificate: true
The value of each of those is definitely "true" but it continues to fail when loading the mssql-store@3.0.0 extension.
Can anyone shed some light on this?
-
Yes, we aren't parsing those environment variables as bools so the mssql package complains because those are strings.
Could you try to pass the uri with those configs if that helps for now?
extensions_mssqlStore_uri=Server=localhost,1433;Database=database;User Id=username;Password=password;Encrypt=true
-
I tried the uri and it does work. That will do the job for now.