Options

BC 22.0 Import-NAVEncryptionKey The provided encryption key file contains invalid data

Hello,

I'm trying to install Business Central 22.0 on an Azure VM.
I have created an Azure SQL database with a dba owner user.
The database encryption has been enabled (CREATE MASTER KEY ENCRYPTION BY PASSWORD = '').

Now I want to configure the database user and password for the BC service tier.

New-NAVEncryptionKey -KeyPath "C:\Temp\BC.key" -Password (Get-Credential).Password

I'm not sure wat password I should use. I have to fill-in an username and password.
So I use the credentials from the database user.

Than I want to import the key.

Import-NAVEncryptionKey -ServerInstance <BC Service tier name> -KeyPath "C:\Temp\BC.key" -ApplicationDatabaseServer <Azure Instance> -ApplicationDatabaseName "<Azure database name>" -ApplicationDatabaseCredentials (Get-Credential)
I use the credentials from the database user.

Now I get an error:

Import-NAVEncryptionKey : The import failed. The provided encryption key file contains invalid data and could not be imported.
At line:1 char:1
+ Import-NAVEncryptionKey -ServerInstance <BC Service tier name> -KeyPath "C:\Te ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (0:Int32) [Import-NAVEncryptionKey], NavEncryptionInvalidKeyFileException
+ FullyQualifiedErrorId : MicrosoftDynamicsNavServer$<BC Service tier name>,Microsoft.Dynamics.Nav.Management.Cmdlets.Impor
tNavEncryptionKey

I have no clue why the encryption key file has invalid data. Are there some invalid characters in the password, like %, $ or ....?

Answers

  • Options
    edwinschuttenedwinschutten Member Posts: 17
    I found the problem, there was a typo in the password of the key file. It would be nice if the error was "invalid password".
Sign In or Register to comment.