Hi,
I´m having some issues with using a variable as the password for doing a database backup step. I use variables called “databasePassword” and scope them per environment and then I use that variable for the “SQL password” box (I tick the box for custom binding and then select the variable “databasePassword” so the text field then reads “#{databasePassword}”.
2 of 4 environments works fine, on the other 2 I get a login error:
ConnectToDatabase : An error occurred connecting to the database server!
System.Management.Automation.MethodInvocationException: Exception calling “Connect” with “0” argument(s): “Failed to connect to server …” —> Microsoft.SqlServer.Management.Common.ConnectionFailureException: Failed to connect to server … —> System.Data.SqlClient.SqlException: Login failed for user ‘xxx’.
Trying the same username password when logging into to the SQL server using Management Studio works fine, as does using the password directly in the SQL password field on the db backup step in Octopus so the actual credentials are fine and the user has the same roles on all servers.
It doesn´t matter if I mark the variable to be sensitive or not.
A bit lost, don´t know how to resolve this and I need the variable as we have different passwords on the servers.
BR, Petra