JSON Configuration Variables not working on some variables

(oliverrc) #1

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.

#3

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

(oliverrc) #4

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