Open sami3187 opened 1 year ago
The error message suggests that you check which permissions the user running the PoSh script has on the database. Did you doublecheck that?
Thanks for your reply . how to check that "check which permissions the user running the PoSh script has on the database."
Do we need App Registrations in Azure Portal ?
@KennieNP Could you please advise. thanks.
Thanks for your reply . how to check that "check which permissions the user running the PoSh script has on the database."
You can use SSMS to see users and their permissions
if (!$RestartingInstance) {
Write-Host „Use custom user to access database“ $DatabaseUserName = „DBAdmin“ $DatabasePassword = „D$1234567“ $EncryptionPassword = „abc123ABC$%&abc123“ $TrustSQLServerCertificate = $true $ServiceTierFolder = „C:\Keys\“ $DatabaseServer = „sqlxx.database.windows.net“ $DatabaseSecurePassword = ConvertTo-SecureString -String $DatabasePassword -AsPlainText -Force $DatabaseCredentials = New-Object PSCredential -ArgumentList $DatabaseUserName, $DatabaseSecurePassword $DatabaseName = „BC210-DB“ $EncryptionKeyPath = Join-Path $ServiceTierFolder ‚BC.key‘ $EncryptionSecurePassword = ConvertTo-SecureString -String $EncryptionPassword -AsPlainText -Force New-NAVEncryptionKey -KeyPath $EncryptionKeyPath -Password $EncryptionSecurePassword -Force | Out-Null
Write-Host „Import Encryption Key“
Import-NAVEncryptionKey -ServerInstance DAF -ApplicationDatabaseServer $DatabaseServer -ApplicationDatabaseCredentials $DatabaseCredentials -ApplicationDatabaseName $DatabaseName -KeyPath $EncryptionKeyPath -Password $EncryptionSecurePassword -WarningAction SilentlyContinue -Force
Set-NAVServerConfiguration -ServerInstance „DAF“ -KeyName „EnableSqlConnectionEncryption“ -KeyValue „true“ -WarningAction SilentlyContinue Set-NAVServerConfiguration -ServerInstance „DAF“ -KeyName „TrustSQLServerCertificate“ -KeyValue $TrustSQLServerCertificate.Tostring().ToLowerInvariant() -WarningAction SilentlyContinue Set-NavServerConfiguration -serverinstance „DAF“ -databaseCredentials $DatabaseCredentials }
Any Suggestions for the below error cause.
Error :