Converting Azure pipeline parameter type of object, which contain an array of strings, to an array object in bash script task is not clearly documented. We can use the join expression for Azure pipeline tasks to achive this requirement. Let's look at how to do with an example.
Imagine we have app list in a yaml template parameter as shown below.
If we want to get the parameter array converted to a bash array we can use join expression for Azure pipeline tasks as following.
The full template with the bash task to print the values from parameter would be as shown below.
A pipeline can be implemented to use the template as follows.
When the pipeline is running the template aprameter values are converted to a bash array and can be printed in the logs.
No comments:
Post a Comment