As a DBA I would like to be able to view all the connection strings used in configs, to validate that they adhere to naming conventions for different environments dev/test/prod etc.
Where in the Octopus database backend do I find the connection strings used in deployments to do such a validation ?
Thanks for getting in touch! Octopus dose not store any of your deployments connection strings in the database unless they are input and saved as variables in a project or as a variable set.
If the connections strings are a part of a package being deployed, generally in a config file, we will have no recording of the value. Octopus will only transform configuration files and evaluate any variables.
If these values have been manually input into Octopus as variables, then you could use the API to collect this information.
Let me know if I have missed anything here or if you have any further questions.
I checked with our admin team that is using the Octopus interface. They do enter all connection strings as variables. So if I understand you correctly they are somewhere in the database, probably stored as a part of a string. If you tell me where, I could easily query those fields and parse out the conn string info. But it I go the API way I need to invoke resources from other teams, wich I prefer not to.
Thanks for getting back. There are two places we could store these variables in the Octopus database.
The first is per-project: [DatabaseName].[dbo].[VariableSet]:
Id
OwnerId
Version
IssFrozen
JSON
variableset-Projects-1
Projects-1
3
0
{see JSON below}
The second are library variable sets: [DatabaseName].[dbo].[LibraryVariableSet]
The variables for both variable types are stored as JSON in the Database, an example from my VM is below. This is the JSON result from querying my Octopus server’s database under dbo.VariableSet. The OwenerId is used to identify which project you are looking at in the DB. In this case it is the project with the ID of Projects-1.