How to dump variable set into file

I would like to put all variables from varibaleset into json file as Octopus step, don’t want to use API.
Is it possible to dump variable set into file?



The only real way to get access to the variables from a variable set in JSON is through the API. I know that you said you don’t want to use the API, but this is really the only reliable way of getting the data you want out of Octopus.

However, there are a number of different ways that you could access the data from the API. The most direct way is to write some code to request the data from the API. Here is some sample PowerShell Code that gets you most of the way there.

You could also use a tool like Postman to execute the requests for you.

Another way would be to use the Octopus Migrator with the export command. This would need to be run on the Octopus Deploy server.

Similarly, if you are only interested in exporting a variable set from a project, you could use octo.exe and its export command.

If you are using the latest version of Octopus Deploy (3.17), then you could use our new Swagger support to help you query the API.

Finally, as described here you could simply use your browser developer tools to explore the API and copy the JSON when the response is returned to the client. For example, if you open up the Network tab in the Chrome Dev Tools when you open a variable set, you should see something like the screenshot that I have attached.

Hope that was helpful. Let me know if you have any more questions, or if you need any more specific help with any of these options.