With an ARM template deployment step it’s easy to use parameters and re-use template outputs as Octopus output variables. In the Azure Web App deployment step the json configuration feature makes it easy to do configuration transforms in appsettings.json by providing hierarchical variables named to match the json syntax but delimited with : as described here
As much as possible we are trying to treat the resource group deployments via arm templates as the source of truth for any deploy time configuration information such as connection strings, storage or app names and similar configuration details.
Is there any built in way to use the outputs from the arm template deployment step as variables for the json configuration feature step?
Its not possible out of the box to use output data from one ARM Template step on another one (for the json config), but you could do the following:
A) If the data is static, meaning it doesn’t get created within the first ARM template run, then you could use a single Project Variable on both the ARM template step, and the JSON config one.
B) If the data you are trying to carry to the JSON config step is something like an ID that gets generated when you run the ARM template. then you could do something like:
For our case I think option B would be more fitting, but we couldn’t find a way to use output variables to transform the variables defined in the appsettings.json. Would we just reference the output variables directly using the variable binding syntax like this?:
That’s right. You’ll need to change StepA with the name of the step from where you created the variable, and TestResult with the name of the variable you created using the -name parameter of the Set-OctopusVariable cmdlet.