Where are Octopus variables in Octopus SQL DB?

I need to query all Octopus projects that have a special variable. In what table in the Octopus SQL Server database is that info?

Regards - Anders

Hi Anders,

Thanks for getting in touch!

We don’t recommend getting this info from the database, but instead we’d urge getting this info via the API. Check out our wiki page which should provide a good starting point in getting familiar with the API.

Don’t hesitate to reach out if you have any further questions.

Kind regards,

Kenny

We successfully go directly to the database just to extract some statistics. And I like to just do that for variables. So in what table are they?

Hi Anders,

Thanks for following up. Touching data via the database is both unsafe and will void your warranty, so to avoid risk we won’t condone accessing the database. Changes in the database could have cascading effects on all corresponding records and references, and could potentially break the UI. For this reason we only recommend using the API.

Sorry it’s not the news you were after. Let me know if you have any further questions or concerns.

Kind regards,

Kenny

Ok, but do you have any advice how I from the API can search for projects with specific content in variables then?

Best Regards – Anders Lundsgård

Hi Anders,

Thanks for following up! There’s an Open Source module called Octoposh that provides cmdlets to interact with the API. You can check out the OctoPosh wiki which includes details on all of the available cmdlets.
http://octoposh.readthedocs.io/en/latest/

Using it along with some extra Powershell, you could search all the variables containing a specific value like the example I’ve made available here. :slight_smile:

I hope this helps! Let me know if you have any further questions going forward.

Best regards,

Kenny