The Usernames/Passwords account type is only used for SSH connections, and can’t be used with variable substitution. However, you should be able to use normal variables for these usernames and passwords. Is something preventing this?
The username and passwords are referenced by multiple projects, Since I am setting these values from Powershell i was hoping to only update/create a ‘global’ variable referenced by multiple projects rather than setting each individual project.
I think i will just have to update each project - thanks!
A Library Variable Set will allow you to define the variables in one place and then share them among as many projects as you need. You can still scope library variables to targets. Can you use them instead?
This should work. I am having some issues adding a scope to the Library Variable Set via PowerShell based on this example
Do you know how i can attach the machine name into the VariableScopeValues machines list?
$libraryVariableSetId = “LibraryVariableSets-21” # Get this from /api/libraryvariablesets
$variableName = “test” # Name of the new variable
$variableValue = “1234” # Value of the new variable
I have ran into another issue. Since the variable library sets are per target now and referenced from each project. When i provision a new target a variable is added into the set and scoped to that target. I then have to create a new release to reference the updated value for every project - is there any way around not having to create a new release?
There certainly is! I’m assuming you are referring to manually updating the snapshotted variables for a release. On the release screen, there is a link you can click labelled “Update variables”. This will update the snapshotted variables for that release to the latest from all sources.
If you mean that you wish to automatically update the variable snapshots for a set of releases, that is definitely possible via the API as well but is more complex. If that is the case, let me know and we can work through that together.