JSON Variable Replacement doesn't replace identity settings

Hi

I have an ASP.Core website that I’m trying to apply a JSON Variable replacement transform on, however it’s not working. The appsettings.json file that i’m trying to change is:

{
  "HttpClientSettings": {
    "LgApiUri": "http://localhost:6010/api/lg",
    "ManagerApiUri": "http://localhost:49285/api",
    "BingMapUrl": "http://www.bing.com/api/maps/mapcontrol?callback=GetMap"
  },
  "IdentitySettings": {
    "Authority": "https://auth-test.example.co.uk/identity",
    "ClientId": "dev",
    "ClientSecret": "localexample",
    "SignedOutRedirectUri": "http://localhost:4008/"
  },

  "Logging": {
    "IncludeScopes": false,
    "LogLevel": {
      "Default": "Warning"
    }
  }
}

most of the config correctly changes upon deployment, however, this one does not:

  "IdentitySettings": {
    "Authority": "https://auth-test.example.co.uk/identity",
    "ClientId": "dev",
    "ClientSecret": "localexample",
    "SignedOutRedirectUri": "http://localhost:4008/"
  },

the “Authority” field should change to “https://auth.example.co.uk/identity”, but instead it doesn’t change. I have set up a project variable like so:

However, when i create a release and deploy the site, it still shows as auth-test.

Any help would be greatly appreciated.

Hi Andy,

Thanks for getting in touch and providing so much detail.

I’ve tried to reproduce the issue but the IdentitySettings:Authority variable is getting replaced in my JSON config file (identical to yours). I have the variable scoped to the environment I am deploying to, similar to yours.

Which version of Octopus Server are you using to deploy this?

Could you send a raw deployment log with variables included in the log? (https://octopus.com/docs/support/debug-problems-with-octopus-variables#DebugproblemswithOctopusvariables-Writethevariablestothedeploymentlog) You can send me a message directly with the log attached to keep it private.

Cheers,
Shane

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