Hello,
I am wondering now that octopus supports Certificate type variables, can a certificate variable be set by a step? I generate self signed certs by IPAddress for testing on the fly using a deployment step. My question is when I generate the cert using PowerShell can I then set a certificate variable in octopus in that step? This would allow me to then reference the cert in later steps since it is dynamically generated by target.
Hi Brad,
Thanks for getting in touch! Generally when you need a step to set a variable to be referenced in a subsequent step, we recommend using output variables. However, since certificates are a specific type of variable, and output variables are defined as text (i.e. there’s no way to pass an array of bytes between steps), you may need to do some working around it to store the certificate as an encoded base64.
If you’re able to accomplish that, you can store the value in the output variable using the syntax Set-OctopusVariable -name "certificate" -value "Value"
. Then you can call the variable name in later steps by specifying the step name that set it using the syntax #{Octopus.Action[StepName].Output.certificate}
.
I hope this helps get you going! Let me know what you think. If this doesn’t address your requirements fully, would you be willing to elaborate on your scenario and exactly what you’re looking to achieve? I’ll be happy to re-think this and help you find the best solution.
Best regards,
Kenny
Thanks Kenny,
I will use this method if I must but I was hoping to use all the great new built in Certificate features like binding in IIS, etc. It would be nice to be able to set a certificate variable dynamically instead of pre-packaging certificates.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.