Variables

Is is possible to print out all the variables configured in Octopusdeploy? If not are the variables stored in a file that is accessable?

Thanks

Hi,

Thanks for getting in touch! Octopus variables aren’t stored in any file. As there are different kinds of variables (system variables, library variable sets, project variables), which variables are you wanting to retrieve? Knowing a bit more about your requirements and what you’re after will help us come to the best solution. :slight_smile:

I look forward to hearing back!

Best regards,

Kenny

Hi
Actually I would like to gather an editable list of all the variables for the purpose of documentation and further review of additions or simplification of the variables we use.

Regards, Ed

Hi Ed,

Thanks for following up. Unfortunately we don’t have any built-in way to collect and print all variables. Since there are different kinds of variables, which are stored separately, this would need to be done manually for each location in which we store the variables. This would be for each project, library variable set, tenant variables, etc.

Via the API, you could do something like:

  • get all projects, order alphabetically
  • print out name of the project
  • print out all of its variables

Then do something similar for your variable sets, and tenant variables. You’d also need to make sure you’re logged in as a user with access to all things you could scope these variables to.

We have some example API scripts available in our API repository here which may help provide a good starting point.

Sorry it’s not better news. Let me know if you have any further questions at all.

Best regards,

Kenny