Error importing NAV License in AzureSQL Database

When opening a database installed in AzureSQL, you may get this error:

The database on the server requires a Per Database license to be opened on SQL Azure

You must use Powershell to import the Dynamics NAV license. To import a license file to a AzureSQL database I used the following command:

Import-NAVServerLicense DynamicsNAV100 -LicenseData ([Byte[]]$(Get-Content -Path “C:\Licenses\NAV_2017_DEV.flf” -Encoding Byte))

But I was having the following error:

Reference to database and/or server name in ‘master.dbo.$ndo$srvproperty’ is not supported in this version of SQL Server

To resolve it, I needed to add an additional parameter to the command: “-Database 2”.

Import-NAVServerLicense DynamicsNAV100 -LicenseData ([Byte[]]$(Get-Content -Path “C:\Licenses\NAV_2017_DEV.flf” -Encoding Byte)) -Database 2

UPDATE: In order to use this command, you have to import Dynamics NAV powershell modules running this “Import-Module “C:\Program Files\Microsoft Dynamics NAV\100\Service\NAVAdminTool.ps1″ -force”, prior to using the Import-NAVServerLicense command.

 

From Microsoft Dynamics NAV 2016 documentation:

https://msdn.microsoft.com/en-us/library/jj672905(v=nav.90).aspx

-Database<LicenseDatabase>

Specifies the database into which to import the license file. The possible values are described in the following list:

Default = 0

Default; overrides the license file currently in use.

Master = 1

Forces the license file to be global.

NavDatabase = 2

Forces the license file to be local and stored in the Microsoft Dynamics NAV database that is used by the specified Microsoft Dynamics NAV Server instance.

Tenant = 3

Forces the license file to be local and stored in the Microsoft Dynamics NAV database that is used by the tenant that is specified in the Tenant parameter.

 

Regards,
Ricardo Paiva Moinhos
www.ricardomoinhos.com

4 Comments

  1. Hi Ricardo,

    i am trying to execute this command on azure VM machine where i have installed nav. i have sucessfully created sql database on azure sql and i can access that from azure vm. when i am accessing through nav development enviornment getting above error you have described.
    therefore, when i am running this command first, my windows powershell can not find it.
    can you please help me? i am using NAV 2016
    Thanks,

    • Hi,

      I had some issues with my blog and I wasn’t notified of your comment.
      Were you able to figure it out?
      In order to use the Import-NAVServerLicense you need to import additional modules. In this case, you must run “Import-Module “C:\Program Files\Microsoft Dynamics NAV\100\Service\NAVAdminTool.ps1″ -force” prior to use the Import-NAVServerLicense.
      I’ve updated my article.

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload the CAPTCHA.