WebReports can use an encrypted database connection string instead of storing the connection information in plain text.
Use this article to generate an encrypted WebReports database connection string in VDM and update the WebReports appsettings.json file.
Before You Begin
Before encrypting the WebReports connection string:
- Make sure you have access to VDM.
- Make sure you have access to the WebReports installation directory.
- Make sure you have permission to edit
appsettings.json. - Create a backup copy of
appsettings.jsonbefore making changes. - Have the WebReports Company ID, WR License Key, and current database connection string available.
Use caution when editing
appsettings.json. Incorrect formatting can prevent WebReports from loading correctly.
Open WR App Settings in VDM
- Open VDM.
- Select Help.
- Select WR App Settings.
Opening WR App Settings in VDM
Open the WebReports appsettings.json File
- Navigate to the WebReports installation directory.
- Locate
appsettings.json. - Open the file in a text editor with the appropriate permissions.
WebReports appsettings.json configuration file
Locate the Required WebReports Values
In appsettings.json, locate the following values:
- Company ID
- WR License Key
- Connection String
Copy these values so they can be entered into WR App Settings in VDM.
WebReports values required for connection-string encryption
SQL Server Instance Note:
If the SQL Server instance in the connection string contains a double backslash (\\), change it to a single backslash (\) before entering the connection string in VDM.
Enter the WebReports Information in VDM
In WR App Settings, enter or paste the following:
- Company ID
- WR License Key
- Connection String
Confirm that the information matches the values from the WebReports appsettings.json file.
Entering the WebReports configuration information in VDM
Create the Encrypted Connection String
- Select Create WebReports Database Connection String.
- VDM generates the encrypted database connection string.
Generating the encrypted WebReports database connection string
- Copy the encrypted connection string.
Keep the encrypted value available until the WebReports configuration has been updated.
Update appsettings.json
Return to the WebReports appsettings.json file.
- Locate the
DefaultConnectionsetting. - Replace the existing connection string with the encrypted connection string generated in VDM.
- Locate the
EncryptedConnectionsetting. - Set the value to:
"EncryptedConnection": "true"
WebReports configured to use the encrypted connection string
Save the Configuration
- Save the changes to
appsettings.json. - Close the text editor.
- Confirm that the encrypted connection string was saved under
DefaultConnection. - Confirm that
EncryptedConnectionis set to"true".
If WebReports does not recognize the updated configuration, restart the WebReports application and verify the settings again.
Troubleshooting
WebReports Cannot Connect to the Database
If WebReports cannot connect after updating the connection string:
- Confirm that the complete encrypted connection string was copied from VDM.
- Confirm that the encrypted value was entered under
DefaultConnection. - Confirm that
EncryptedConnectionis set to"true". - Verify that the correct
appsettings.jsonfile was edited.
VDM Does Not Generate the Connection String
- Confirm that the Company ID is correct.
- Confirm that the WR License Key is correct.
- Confirm that the database connection string was entered correctly.
- If using a named SQL Server instance, confirm that the instance uses a single backslash (
\) in VDM.
WebReports Does Not Start After Editing appsettings.json
- Reopen
appsettings.json. - Confirm that the JSON formatting is valid.
- Confirm that quotation marks and commas were not accidentally removed.
- Restore the backup copy if necessary.
If the issue continues, contact BridgeWorks Support.
Comments
0 comments
Please sign in to leave a comment.