Using certificate thumbprint to replace appsettings.json using the 'JSON Configuration Variables'-feature

I have a certificate stored in Octopus. During deployment of our service, I need to get the thumbprint from the certificate and stamp it into the appsettings.json file.

We already have several configurations being replaced using standard Octopus variables using this syntax ServiceOptions:MyOption:MyValue.

My issue is that the certificate variable (MyCertificate) is dynamically expanded into MyCertificate.Thumbprint, and this does not match the pattern I need to replace for example ServiceOptions:Certificate:Thumbprint.

I first look at output variables, but those can not be used with the JSON Configuration Variables feature.

Is there any good way to approach this?

I found a solution. Variables can reference other variables, so the following worked:

ServiceOptions:Certificate:Thumbprint -> #{Certificate.Thumbprint}

Hi Kasper,

Thanks for getting in touch! I am glad you figured this out.
Please let us know if you have any further issues or questions.

Vanessa