Is there a way to call an external API, then take that value and use it in variable substitutions?
Eg.
Step 1: call external API chad get value, set octopus var “var1” to the returned value
Step 2: deploy a package, and in the var substitution use the value returned to replace value in web.config or app.config
Yes, you sure can call an API, store the result and then make use of it. One way is to use Output Variables. Here’s what I did to check; I made a twostep project. I called the first step: Get Api Variable, and it ran the following PowerShell script code (you can pick other languages):
The next part of this process is to make sure that config file gets picked up and processed for variable substitution, I chose the Substitute variables in files option which you can activate for your step by going to Configure features near the bottom of the step setup page. It launches a pop-up for extra items you can have as part of your steps.