Skip to main content What is Dynamics 365? Guided tours Customer stories Try our products Build your own agents CRM ERP Sales Service Sales Customer Insights Customer Service Contact Center Field Service Supply Chain Management Commerce Finance Project Operations Human Resources Business Central Pricing Business application topics Training & certifications Migrate to the cloud Documentation Events Dynamics 365 Blog Product updates Onboarding and implementation Community Find a partner Software Development Companies Partner resources Microsoft Marketplace Product documentation Technical support On-premises product support Contact us Try for free Sign in
  • 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.