Additional NAV Instances in azure sql

manikandanmanikandan Member Posts: 160
Hi All,
When i am trying to import Key using below comments i am getting following error message .Please help me

Export-NAVEncryptionKey -ServerInstance LSVDB2017 -KeyPath 'C:\ProgramData\Microsoft\Microsoft Dynamics NAV\100\Server\Keys\LSVDB2017.key' -Password (Get-Credential).Password | Import-NAVEncryptionKey -ServerInstance NewInstance2017j2ve8sjtrcmv.png

Note:
The Aim is need to create multiple instance and need to connect with out any issue
Already having one instances with out having any issue .The issue comes when i am trying to create new instances

Regards,
Muthu

Answers

  • pradipradi Member Posts: 15
    Use the below command in Windows Powershell ISE

    Execute the script line by line so that you can check where you go wrong.

    Remove the comment provided.

    The below script will help to restart a new service in AZURE ENVIRONMENT.


    $Credentials = (New-Object PSCredential -ArgumentList 'sqluser',(ConvertTo-SecureString -AsPlainText -Force 'sqlpassword')) //sql user name in 'sqluser'& ans passwod in sqlpassword to login in nav db
    $License = "D:\File\5278.flf" //license file path
    Import-module "C:\Program Files\Microsoft Dynamics NAV\100\Service\NavAdminTool.ps1"
    Install-WindowsFeature -Name NET-HTTP-Activation
    New-NAVEncryptionKey -KeyPath "C:\NavTemp\DynamicsNAV2.key" -Password (ConvertTo-SecureString -AsPlainText -Force 'sqlpassword') //a keyfile must be created in a location and sql login password needs to be provided in place of sqlpassword
    Import-NAVEncryptionKey -ServerInstance INSTANCENAME -ApplicationDatabaseServer AZURESERVERNAME -ApplicationDatabaseCredentials $Credentials -ApplicationDatabaseName 'AZUREDATABASENAME' -KeyPath "C:\NavTemp\DynamicsNAV2.key" -Password (ConvertTo-SecureString -AsPlainText -Force 'sqlpassword') -Force -Verbose //INSTANCENAME should be azure service instance name , AZURESERVERNAME sould be azure db server link, password SQL login password
    Set-NAVServerConfiguration INSTANCENAME -KeyName DatabaseServer -KeyValue AZURESERVERNAME -Force //INSTANCENAME & AZURE SERVER LINK
    Set-NAVServerConfiguration INSTANCENAME -KeyName DatabaseName -KeyValue 'AZUREDATABASENAME' //INSTANCENAME & AZURE DATABASE NAME
    Set-NAVServerConfiguration INSTANCENAME -KeyName EnableSqlConnectionEncryption -KeyValue true //INSTANCE NAME
    Set-NAVServerInstance INSTANCENAME -Restart //INSTANCE NAME
  • KishormKishorm Member Posts: 921
    Maybe the path doesn’t exist. Try using something like c:\temp\mykey.key instead (assuming you have a c:\temp folder).
  • manikandanmanikandan Member Posts: 160
    Hi ,
    When i am trying to execute below line i am getting error message
    Import-NAVEncryptionKey -ServerInstance DynamicsNAV100 -ApplicationDatabaseServer TESTSERVER -ApplicationDatabaseCredentials $Credentials -ApplicationDatabaseName 'TESTdatabase' -KeyPath "C:\ProgramData\Microsoft\Microsoft Dynamics NAV\100\Server\Keys\DynamicsNAV100.key" -Password (ConvertTo-SecureString -AsPlainText -Force 'password@123') -Force -Verbose

    Import-NAVEncryptionKey : Cannot establish a connection to the SQL Server/Database.

    This could be due to one of the following reasons:
    * SQL Server is not started.
    * The database does not exist.
    * Proper permissions have not been given to the NAV Server Account.
    Try again later or contact your system administrator.
    At line:1 char:1
    + Import-NAVEncryptionKey -ServerInstance DynamicsNAV100 -ApplicationDatabaseServe ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (0:Int32) [Import-NAVEncryptionKey], NavCSideException
    + FullyQualifiedErrorId : MicrosoftDynamicsNavServer$DynamicsNAV100,Microsoft.Dynamics.Nav.Management.Cmdlets.ImportNavEncryptionKey


    But i can able to open RTC with existing service
    Kindly help
  • pradipradi Member Posts: 15
    In the following path

    Path : C:\ProgramData\Microsoft\Microsoft Dynamics NAV\110\Server\Keys\abc.key


    The service name key would be present. If you receive the above error. Delete the key present in the above path. The try running the script.

    A temporary folder needs to be created to store the key according to the script.

    Note : (You can delete the key from the path and in server administration click on the instance -- go to configuration file and enter nav database USERID and password. and restart the service. The service will be restarted.)
Sign In or Register to comment.