How to Upload Dynamics NAV/D365 Business Central License with Azure SQL database?

Step-1: Open Windows Powershell ISE as administrator.
Step-2: Create *.ps1 script file save with below content

$Credentials = (New-Object PSCredential -ArgumentList <azure_sql_username>,(ConvertTo-SecureString -AsPlainText -Force <azure_sql_Password>))

$License = "C:\AzureScript\BusinessCentral.flf"

Import-module "C:\Program Files\Microsoft Dynamics 365 Business Central\130\Service\NavAdminTool.ps1"

Install-WindowsFeature -Name NET-HTTP-Activation

New-NAVEncryptionKey -KeyPath "C:\AzureScript\D365BC.key" -Password (ConvertTo-SecureString -AsPlainText -Force <azure_sql_username>) -Force
Import-NAVEncryptionKey -ServerInstance DynamicsNAV130 `
-ApplicationDatabaseServer 'xxxxx.database.windows.net' `
-ApplicationDatabaseCredentials $Credentials `
-ApplicationDatabaseName 'D365BC_DEV' `
-KeyPath C:\AzureScript\D365BC.key `
-Password (ConvertTo-SecureString -AsPlainText -Force <azure_sql_username>) `
-Force -Verbose

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

Set-NAVServerConfiguration DynamicsNAV130 -KeyName DatabaseServer -KeyValue xxxxx.database.windows.net -Force

Set-NAVServerConfiguration DynamicsNAV130 -KeyName DatabaseName -KeyValue 'D365BC_DEV'

Set-NAVServerConfiguration DynamicsNAV130 -KeyName EnableSqlConnectionEncryption -KeyValue true

Set-NAVServerInstance DynamicsNAV130 -Restart
Import-NAVServerLicense DynamicsNAV130 -LicenseFile $License -Database NavDatabase -Force

Step-3: Save and run.

Comments