JSON Configuration Variables not working on some variables

As stated it seems some variables are not being replaced by the “JSON Configuration Variables” feature.

Our appsettings.json looks as follows:

{
  "ApplicationInsights": {
    "InstrumentationKey": "..."
  },
  "Octopus": {
    "ServerAddress": "...",
    "ApiKey": "API-..."
  }
}

In Octopus Server we have set the variables as follows

  • ApplicationInsights:InstrumentationKey
  • Octopus:ServerAddress
  • Octopus:ApiKey

The ApplicationInsights.InstrumentationKey replacement works fine but neither of the Octopus.*
variables are replaced. They remain unchanged after the deployment.

The log clearly shows that the replacement has found and worked on the appsettings.json

11:58:46 Info | Performing JSON variable replacement on 'C:\Octopus\Applications\Dev\MyApp\1.0.0.20_3\appsettings.json'

I had a look at the “JsonConfigurationVariableReplacer” and could see no indication of “Octopus” as a reserved word.

I’m scratching my head why this isn’t working.

Hi @oliverrc,

Thanks for getting in touch, and sorry for the confusion on this one!

You’re theory that Octopus was a reserved word is correct, it was just hiding down on line 185. If you remove Octopus from the variable names you should be good to go.

Please let me know if there is anything else I can help with.

Regards,
Alex

Ah damn, right there plain as daylight. Sorry about that, completely missed it. Appreciate the feedback, will try find a different name.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.