1

I would like to be able to pass variable amount of specific strings into resources. For example I have a list of hostnames and a parameter "number of hostnames" and when changing the number, value in the resources also change. enter image description here

How can I do that? I can't use take-array function as arrays have "name": "value" scheme, and I only need to pass "values".

yoape
  • 3,285
  • 1
  • 14
  • 27
WinBoss
  • 879
  • 1
  • 17
  • 40

1 Answers1

5

If your array is formed like your host names, you can use take. There is not need to add "name":"value" pairs into your array.

"variable":{
   "test":[
      "s1","s2"
   ],
   ...
 },
 "resources":[
   ...

   "hostnames": "[take(parameters('count'),variables('test'))]",  
Peter
  • 27,590
  • 8
  • 64
  • 84