Variable substitution different for a single project

We are using version 3.3.22 for a while and have not had any issues until now. We are using Octopus for multiple projects but now we have one that uses a different database than the others. I can set the new database profile as a local variable to the project and it uses the local variable as opposed to the global variable correctly. However it does not do this for the username and password. After deployment the connectionString in the web.config shows this -

UID={SybaseDB_UID};Password={SybaseDB_Password}

It just so happens the userid and password is the same as the DB the other apps are using so I tried not adding them to the local project and assumed it would grab them from the global variable set. I still receive the same setting as above.

We have dealt with username/password differences in projects and have not had issues. It pulls from the local variable set like it should. Those situations did not deal with the connectionString section however. I’m not sure if that has anything to do with it or not.

Do you know what is gong on here?.

Hi,

Thanks for getting in touch! I’m sorry you’re hitting this roadblock. Based on what your web.config file shows, UID={SybaseDB_UID};Password={SybaseDB_Password}, I suspect the issue may just come down to the syntax. To perform variable substitution, the variable name within your config file needs to use the syntax #{VariableName}, and it looks like the # is missing in your config. Could you confirm if this is the case, and if updating it fixes it?

If it’s already set correctly, could you attach your verbose deployment log so we can take a closer look? The following documentation page outlines how you can produce and export this.
https://octopus.com/docs/how-to/how-to-turn-on-variable-logging-and-export-the-task-log

Feel free to mark this thread as private if you attach the log.

I look forward to hearing back!

Best regards,

Kenny

It was the #. I had a local variable referencing other local variables and missed the # ones being referenced.

It works now.

Thanks. You can close the ticket.

Hi Ely,

That’s great to hear it’s working now! Don’t hesitate to reach out if you have any questions going forward. :slight_smile:

Best regards,

Kenny