I have a release pipeline with a variable, but there doesn't seem to be any way to set the value of that variable to something that's evaluated at release time. For example, another variable.
Here's a real example:
All I want to do is set the value of MyExpressionBasedVariable
to the value of MyOtherVariable
.
All the docs and examples online seem to suggest it's possible, but I can't get it to work. I always end up with the literal string rather than the evaluated value.
I've tried using these different syntaxes:
$(MyOtherVariable)
$[variables['MyOtherVariable']]
${{variables['MyOtherVariable']}}
I've seen that you can define custom tasks to set variable names as part of the pipeline but this seems massively overkill.
Essentially all I want to do is rename a key vault secret to a different variable name for convention-based XML variable replacement in config files.
E.g. I have a secret called this-is-a-secret-name-which-is-a-different-naming-convention-to-my-connectionstrings
but I need it in a variable called MySecret-ConnectionString
.
Foo
=$(Bar)
andBar
=Baz
will result inFoo
=Baz
. It could have something to do with your usage of the variables. Can you update your question with actual usage? – Daniel Mann$(MyOtherVariable)
, even though I can use the same variable directly within pipeline tasks - it just doesn't work within the pipeline variables screen. Facepalm. – theyetiman