Options

Using DLM Automation Powershell cmdlets in CircleCI pipeline

Hi,

I'm trying to set up a CircleCI pipeline to deploy a MSSQL database to AWS using CircleCI and I get a System.Security.Cryptography.CryptographicException: Access is denied. error when invoking any of the DLM Automation Powershell cmdlets.
Do you know what can it be? Is it a missing certificate issue or rather an admin privilege issue?
I do not have the error if I run the cmdlet on my office PC, but there I got the full SQL Toolbelt installed.

This is the error:
Register-DlmSerialNumber, DLM Automation 2.1.3.2175, Copyright c Red Gate Software Ltd 2014-2018

Use of this functionality requires a SQL Toolbelt license.
If you are unsure of your current user license entitlement please contact licensing@red-gate.com

Activating serial number XXX-XXX-XXXXXX-XXXX
WARNING: System.Security.Cryptography.CryptographicException: Access is denied.

   at System.Security.Cryptography.ProtectedData.Protect(Byte[] userData, Byte[] optionalEntropy, DataProtectionScope 
scope)
   at RedGate.DLMAutomation.Compare.RedgateTools.RedgateToolRunner.GetProtectedEnvironmentVariableValue()
   at RedGate.DLMAutomation.Compare.RedgateTools.RedgateToolRunner.Run(GuardedString commandLineArguments, Action`1 
onStdOut, Action`1 onStdErr, String executablePath)
   at RedGate.DLMAutomation.Compare.RedgateTools.RedgateToolRunner.RunCompare(GuardedString commandLineArguments, 
Action`1 onStdOut, Action`1 onStdErr)
   at RedGate.DLMAutomation.Compare.Compare.LicensingFacade.ActivateSerialNumber(String serialNumber)
   at RedGate.DLMAutomation.PowerShell.Commands.RegisterDlmSerialNumberCommandImpl.Process()
   at RedGate.DLMAutomation.PowerShell.DlmAutomationCommandImpl`1.ProcessRecord()
   at RedGate.PowerShell.CommandBase`2.DelegateTo(Action doImplementation)
Register-DlmSerialNumber : An unhandled error occurred: System.Security.Cryptography.CryptographicException: Access is 
denied.
   at System.Security.Cryptography.ProtectedData.Protect(Byte[] userData, Byte[] optionalEntropy, DataProtectionScope 
scope)
   at RedGate.DLMAutomation.Compare.RedgateTools.RedgateToolRunner.GetProtectedEnvironmentVariableValue()
   at RedGate.DLMAutomation.Compare.RedgateTools.RedgateToolRunner.Run(GuardedString commandLineArguments, Action`1 
onStdOut, Action`1 onStdErr, String executablePath)
   at RedGate.DLMAutomation.Compare.RedgateTools.RedgateToolRunner.RunCompare(GuardedString commandLineArguments, 
Action`1 onStdOut, Action`1 onStdErr)
   at RedGate.DLMAutomation.Compare.Compare.LicensingFacade.ActivateSerialNumber(String serialNumber)
   at RedGate.DLMAutomation.PowerShell.Commands.RegisterDlmSerialNumberCommandImpl.Process()
   at RedGate.DLMAutomation.PowerShell.DlmAutomationCommandImpl`1.ProcessRecord()
   at RedGate.PowerShell.CommandBase`2.DelegateTo(Action doImplementation)
At line:6 char:1
+ Register-DlmSerialNumber -InputObject XXX-XXX-XXXXXX-XXXX
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Register-DlmSerialNumber], CryptographicException
    + FullyQualifiedErrorId : UnhandledException,RedGate.DLMAutomation.PowerShell.Commands.RegisterDlmSerialNumberComm 
   and

The CircleCI executor is a 
windows-server-2019-vs2019:stable box.

The Powershell module version is http://psg-prod-eastus.azureedge.net/packages/dlmautomation.2.1.3.2175.nupkg

Sign In or Register to comment.