Dynamics 2016 on Azure SQL Database service

aceX
Member Posts: 166
Hi there,
If anyone have experience with NAV on Azure, please help. The problem is explained bellow:
*We have server which is set on Azure and the database is set on Azure SQL Database service. We need to have two NAV Service instances. One DynamicsNAV100Local, which will be used for development locally on the server, and other one DynamicsNAV100WAN for connection to the service and NAV database from WAN connection.
*Problem is, when I start one of the instance which is logged using SQL user is ok. When I start the second one, I have an error*:
<error>The Microsoft Dynamics NAV 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</error>
When one of the instances will be started, key from that instance is valid and only this instance is starting, when another instance I try to start, automatically service is going to status Stop Pending >> Stopped with explanation that the encryption key is wrong.
Using specifications to set up the system, to start up the Service instance, it must to use SQL authentication.
Thank you in advice
Best Regards
If anyone have experience with NAV on Azure, please help. The problem is explained bellow:
*We have server which is set on Azure and the database is set on Azure SQL Database service. We need to have two NAV Service instances. One DynamicsNAV100Local, which will be used for development locally on the server, and other one DynamicsNAV100WAN for connection to the service and NAV database from WAN connection.
*Problem is, when I start one of the instance which is logged using SQL user is ok. When I start the second one, I have an error*:
<error>The Microsoft Dynamics NAV 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</error>
When one of the instances will be started, key from that instance is valid and only this instance is starting, when another instance I try to start, automatically service is going to status Stop Pending >> Stopped with explanation that the encryption key is wrong.
Using specifications to set up the system, to start up the Service instance, it must to use SQL authentication.
Thank you in advice
Best Regards
0
Comments
-
Hi,
In NAV Administration console, when you click on the second instance, did you set the parameters in the section AzureKeyVault encryption ?
0 -
Thanks for your suggestion @vremeni4.
I'm not sure which fields should be filled, in this section. Can you send me some manual for this steps - how to fill AzureKeyVault section.
And one more question:
If I use this option, does the client need to buy (subscribe) to Azure Key Vault to be able to use more that one Service and is this possible to be done without additional fees.
Thanks in advice
Best Regards0 -
Hi,
As I had so many issues with Azure SQL I haven't done this for a while so I cannot recall all the necessary steps.
Anyhow these two links should provide necessary information.
https://msdn.microsoft.com/en-us/library/dn951458(v=nav.90).aspx
and this one
https://msdn.microsoft.com/en-us/library/dn951464(v=nav.90).aspx
This video, explains the setup in detailhttps://www.youtube.com/watch?v=_v2XFF4q0Ww
I hope this helps.1 -
All those steps are already accomplished, but examples are showing how to setup the environment with one Service, that's ok in my scenario, but the problem is when I try to work with two or more Service instances of NAV.
In attachment is the message which is describing the problem when I'll try to start second service0 -
Hi,
Did you run thisTo create and import encryption key
In the Microsoft Dynamics NAV 2016 Administration Shell, run the New-NAVEncryptionkey cmdlet.
This creates a file that contains an encryption key. If you already have an encryption key file, you can skip this step.
Run the Import-NAVEncryptionkey cmdlet to install the encryption key on the Microsoft Dynamics NAV Server instance and database.
https://msdn.microsoft.com/en-us/library/dn951464(v=nav.90).aspx
as it was explained here
https://msdn.microsoft.com/en-us/dynamics-nav/microsoft.dynamics.nav.management/import-navencryptionkey
Microsoft Dynamics NAV uses a single encryption key per server instance.
if you did all the above and it does not work, then I am not sure what is wrong.
I would be really surprised if only one instance can be run per database.
0 -
Hi,
when you create the first instance with database credentials, new key is generated and written in the database, so when you create new instance a new key is generated and written to database, because of this the first instance will stop because of missmatch key
What should you do
Delete the generated key from the second instance,
Location of the key
C:\ProgramData\Microsoft\Microsoft Dynamics NAV\100\Server\Keys
Export the key from the first instance
Export-NAVEncryptionKey -ServerInstance DynamicsNAV -KeyPath "C:\Keys\nav.key"
Import exported key in the second instance
You must provide database credentials in the -ApplicationDatabaseCredentials parameter
$Credential = (New-Object PSCredential -ArgumentList ‘<your Azure SQL Database login name>‘,(ConvertTo-SecureString -AsPlainText -Force ‘<your password>‘))
Import-NAVEncryptionKey -ServerInstance DynamicsNAV -ApplicationDatabaseServer <String>
-ApplicationDatabaseCredentials $Credential -ApplicationDatabaseName <String> -KeyPath <String>
Hope this will work
BR,
Mirce
0 -
Thank you @mircen that's the right solution
. Part with credentials parameter was the key
.
Best RegardsHi,
when you create the first instance with database credentials, new key is generated and written in the database, so when you create new instance a new key is generated and written to database, because of this the first instance will stop because of missmatch key
What should you do
Delete the generated key from the second instance,
Location of the key
C:\ProgramData\Microsoft\Microsoft Dynamics NAV\100\Server\Keys
Export the key from the first instance
Export-NAVEncryptionKey -ServerInstance DynamicsNAV -KeyPath "C:\Keys\nav.key"
Import exported key in the second instance
You must provide database credentials in the -ApplicationDatabaseCredentials parameter
$Credential = (New-Object PSCredential -ArgumentList ‘<your Azure SQL Database login name>‘,(ConvertTo-SecureString -AsPlainText -Force ‘<your password>‘))
Import-NAVEncryptionKey -ServerInstance DynamicsNAV -ApplicationDatabaseServer <String>
-ApplicationDatabaseCredentials $Credential -ApplicationDatabaseName <String> -KeyPath <String>
Hope this will work
BR,
Mirce
0 -
Hi Mirce,
When i am trying to import Key using below comments i am getting following error message .Please help me
0 -
Hi AceX
can you send me your script, i have the same problem but dont works.
thanks
GER0 -
Do you know if this could be done in 2015?0
-
Hi @morfo8741,
The script for above is valid. I've contacted @mircen about the problem described here, and he answered that the steps will be:
(If you have key for the first database)
1. You need to copy the key from the file and name it like your new instance which will use your new database (DynamicsNAV100Example2).
2. This must be done before you start the DynamicsNAV100Example2 service instance.
The trick here is that you must to use the same key for other databases.
Best Regards
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions