Skip to main content
Dynamics 365
  • 1 min read

How Do I Set Up Microsoft Dynamics NAV to work with Azure SQL Database


Dynamics NAV 2016 supports the option of using Azure SQL Database, and we have recorded a “How Do I” video to explain the steps involved in deploying a Dynamics NAV SQL Server database to an instance of Azure SQL Database.

This blog post includes a Windows PowerShell script that can be used to configure the Dynamics NAV 2016 middle-tier service so that it works with an Azure SQL Database as described in the How Do I video:

Script

$Credentials = (New-Object PSCredential -ArgumentList '
',(ConvertTo-
SecureString -AsPlainText -Force ''))

$License = “\SQLDemoDatabase\CommonAppData\Microsoft\Microsoft
Dynamics NAV\90\Database\Cronus.flf”

Import-module "C:\Program Files\Microsoft Dynamics
NAV\90\Service\NavAdminTool.ps1"

Install-WindowsFeature -Name NET-HTTP-Activation

New-NAVEncryptionKey -KeyPath "C:\TEMP\Key\DynamicsNAV.key"
-Password (ConvertTo-SecureString -AsPlainText -Force '
') -Force

Import-NAVEncryptionKey -ServerInstance Dynamicsnav90 `

                        -ApplicationDatabaseServer
lo0jsfp81e.database.windows.net `

                        -ApplicationDatabaseCredentials
$Credentials `

                        -ApplicationDatabaseName 'Demo
Database NAV (9-0)' `

                        -KeyPath
C:\TEMP\Key\DynamicsNAV.key `

                        -Password (ConvertTo-SecureString -
AsPlainText -Force '') `

                        -Force -Verbose

Set-NAVServerConfiguration -DatabaseCredentials
$Credentials -ServerInstance DynamicsNAV90 -Force

Set-NAVServerConfiguration DynamicsNAV90 -KeyName
DatabaseServer -KeyValue lo0jsfp81e.database.windows.net -Force

Set-NAVServerConfiguration DynamicsNAV90 -KeyName
DatabaseName -KeyValue 'Demo Database NAV (9-0)'

Set-NAVServerConfiguration DynamicsNAV90 -KeyName
EnableSqlConnectionEncryption -KeyValue true

Set-NAVServerInstance DynamicsNAV90 -Restart

Import-NAVServerLicense DynamicsNAV90 -LicenseFile $License
-Database NavDatabase -Force  

Get started with Dynamics 365

Drive more efficiency, reduce costs, and create a hyperconnected business that links people, data, and processes across your organization—enabling every team to quickly adapt and innovate.