The scenario is that you have two or more Business Central service instances configured to use the same Azure SQL database. If you update the database credentials for one of the BC instances in the BC Admin Tool then the other BC instance will fail to start again after the next time it it shutdown.
When this happens you see the following error in the Event Viewer:
The NAV application could not be mounted for database <BC Database name> on database server '<Azure SQL DB instance> due to the following error: The Microsoft Dynamics 365 Business Central Server instance cannot connect to the application database because it is using a different password encryption key than the one currently used on the database.
If you encounter this problem you can avoid it by following the steps below:
- When this scenario occurs you have 2 NSTs (NST1 and NST2). You have just changed the credentials for NST2 in the BC Admin tool (Database Credentials option). Now you can restart NST2 successfully but NST1 will fail to start due to the error show above.
- Go to the following folder on the BC Server (path may vary with version): C:\ProgramData\Microsoft\Microsoft Dynamics NAV\160\Server\Keys. You will see two Keys in there: "NST1.key" and "NST2.key"
- In this scenario the NST1.key is causing the problem (you cannot start the NST1 service).
- Backup/delete NST1.key.
- Create a copy of NST2.key and then rename the copy to: NST1.key
- Now change the credentials for the NST1 service in the NAV Admin tool (Database Credentials option) in the same way that you did for NST2 earlier.
After following the above steps both NSTs will start successfully and it will not be necessary to do this again when changing existing NST database credentials in future. However, these steps may be required again if you (a) create new NSTs accessing the same database or (b) delete some existing key from C:\ProgramData\Microsoft\Microsoft Dynamics NAV\160\Server\Keys.